[metacity] display: remove meta_display_screen_for_x_screen



commit 8b98b4b9b939ce50fa8f8e7b25a7134a4fff341f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Jan 8 02:47:37 2017 +0200

    display: remove meta_display_screen_for_x_screen

 src/core/display-private.h |    2 --
 src/core/display.c         |   13 +++----------
 src/core/screen.c          |    4 ++--
 3 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 08d0211..6a488a2 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -304,8 +304,6 @@ struct _MetaDisplay
 gboolean      meta_display_open                (void);
 void          meta_display_close               (MetaDisplay *display,
                                                 guint32      timestamp);
-MetaScreen*   meta_display_screen_for_x_screen (MetaDisplay *display,
-                                                Screen      *screen);
 MetaScreen*   meta_display_screen_for_xwindow  (MetaDisplay *display,
                                                 Window       xindow);
 void          meta_display_grab                (MetaDisplay *display);
diff --git a/src/core/display.c b/src/core/display.c
index 43e91bb..6e186ce 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -885,17 +885,10 @@ meta_display_screen_for_xwindow (MetaDisplay *display,
   if (result == 0 || attr.screen == NULL)
     return NULL;
 
-  return meta_display_screen_for_x_screen (display, attr.screen);
-}
-
-MetaScreen*
-meta_display_screen_for_x_screen (MetaDisplay *display,
-                                  Screen      *xscreen)
-{
-  if (display->screen->xscreen == xscreen)
-    return display->screen;
+  if (display->screen->xscreen != attr.screen)
+    return NULL;
 
-  return NULL;
+  return display->screen;
 }
 
 /* Grab/ungrab routines taken from fvwm */
diff --git a/src/core/screen.c b/src/core/screen.c
index 9877fc5..9831a6e 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -843,10 +843,10 @@ meta_screen_for_x_screen (Screen *xscreen)
 
   display = meta_display_for_x_display (DisplayOfScreen (xscreen));
 
-  if (display == NULL)
+  if (display == NULL || display->screen->xscreen != xscreen)
     return NULL;
 
-  return meta_display_screen_for_x_screen (display, xscreen);
+  return display->screen;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]