[metacity] display: replace get_screens with get_screen



commit 5b0f029a4fd7b2063024d5036f34d9c9977bfb7f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Jun 12 01:23:41 2016 +0300

    display: replace get_screens with get_screen

 src/compositor/compositor-xrender.c |   18 ++++++++----------
 src/core/display.c                  |    6 +++---
 src/include/display.h               |    2 +-
 3 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index ad4ae65..c2ec5e7 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -780,15 +780,14 @@ static MetaCompWindow *
 find_window_in_display (MetaDisplay *display,
                         Window       xwindow)
 {
-  GSList *index;
+  MetaScreen *screen;
+  MetaCompWindow *cw;
 
-  for (index = meta_display_get_screens (display); index; index = index->next)
-    {
-      MetaCompWindow *cw = find_window_for_screen (index->data, xwindow);
+  screen = meta_display_get_screen (display);
+  cw = find_window_for_screen (screen, xwindow);
 
-      if (cw != NULL)
-        return cw;
-    }
+  if (cw != NULL)
+    return cw;
 
   return NULL;
 }
@@ -1813,7 +1812,7 @@ repair_screen (MetaScreen *screen)
 static void
 repair_display (MetaDisplay *display)
 {
-  GSList *screens = meta_display_get_screens (display);
+  MetaScreen *screen = meta_display_get_screen (display);
   MetaCompositorXRender *compositor = DISPLAY_COMPOSITOR (display);
 
 #ifdef USE_IDLE_REPAINT
@@ -1824,8 +1823,7 @@ repair_display (MetaDisplay *display)
     }
 #endif
 
-  for (; screens; screens = screens->next)
-    repair_screen ((MetaScreen *) screens->data);
+  repair_screen (screen);
 }
 
 #ifdef USE_IDLE_REPAINT
diff --git a/src/core/display.c b/src/core/display.c
index 8612d3a..2519ede 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -5346,10 +5346,10 @@ meta_display_get_compositor (MetaDisplay *display)
   return display->compositor;
 }
 
-GSList *
-meta_display_get_screens (MetaDisplay *display)
+MetaScreen *
+meta_display_get_screen (MetaDisplay *display)
 {
-  return display->screens;
+  return display->screens->data;
 }
 
 gboolean
diff --git a/src/include/display.h b/src/include/display.h
index 9a0ee0a..e7e15c8 100644
--- a/src/include/display.h
+++ b/src/include/display.h
@@ -29,7 +29,7 @@
 
 Display *meta_display_get_xdisplay (MetaDisplay *display);
 MetaCompositor *meta_display_get_compositor (MetaDisplay *display);
-GSList *meta_display_get_screens (MetaDisplay *display);
+MetaScreen *meta_display_get_screen (MetaDisplay *display);
 
 gboolean meta_display_has_shape (MetaDisplay *display);
 


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