[gtk+/broadway: 48/71] Move global window list to per-display



commit 77907fec797ff108ddb57e3e244dc37610c87c4e
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Nov 24 19:41:19 2010 +0100

    Move global window list to per-display

 gdk/broadway/gdkdisplay-broadway.h |    1 +
 gdk/broadway/gdkwindow-broadway.c  |   12 +++++-------
 2 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gdk/broadway/gdkdisplay-broadway.h b/gdk/broadway/gdkdisplay-broadway.h
index c4c0056..0f90ff0 100644
--- a/gdk/broadway/gdkdisplay-broadway.h
+++ b/gdk/broadway/gdkdisplay-broadway.h
@@ -50,6 +50,7 @@ struct _GdkDisplayBroadway
   GdkScreen **screens;
 
   GHashTable *id_ht;
+  GList *toplevels;
 
   GSource *event_source;
   GdkWindow *mouse_in_toplevel;
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 274064f..6283f3f 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -74,8 +74,6 @@ G_DEFINE_TYPE_WITH_CODE (GdkWindowImplBroadway,
                          G_IMPLEMENT_INTERFACE (GDK_TYPE_WINDOW_IMPL,
                                                 gdk_window_impl_iface_init));
 
-static GList *all_windows;
-
 GType
 _gdk_window_impl_get_type (void)
 {
@@ -171,7 +169,7 @@ dirty_flush_idle (gpointer data)
   if (client == NULL)
     return FALSE;
 
-  for (l = all_windows; l != NULL; l = l->next)
+  for (l = display->toplevels; l != NULL; l = l->next)
     {
       GdkWindowImplBroadway *impl = l->data;
 
@@ -204,7 +202,7 @@ _gdk_broadway_resync_windows (void)
 
   display = GDK_DISPLAY_BROADWAY (gdk_display_get_default ());
 
-  for (l = all_windows; l != NULL; l = l->next)
+  for (l = display->toplevels; l != NULL; l = l->next)
     {
       GdkWindowImplBroadway *impl = l->data;
       GdkWindowObject *private;
@@ -235,7 +233,6 @@ _gdk_broadway_resync_windows (void)
 static void
 gdk_window_impl_broadway_init (GdkWindowImplBroadway *impl)
 {
-  all_windows = g_list_prepend (all_windows, impl);
   impl->toplevel_window_type = -1;
   impl->device_cursor = g_hash_table_new_full (NULL, NULL, NULL,
                                                (GDestroyNotify) gdk_cursor_unref);
@@ -272,7 +269,7 @@ gdk_window_impl_broadway_finalize (GObject *object)
 
   g_hash_table_destroy (window_impl->device_cursor);
 
-  all_windows = g_list_remove (all_windows, window_impl);
+  display_broadway->toplevels = g_list_remove (display_broadway->toplevels, window_impl);
 
   G_OBJECT_CLASS (gdk_window_impl_broadway_parent_class)->finalize (object);
 }
@@ -334,7 +331,6 @@ _gdk_window_impl_new (GdkWindow     *window,
   screen_broadway = GDK_SCREEN_BROADWAY (screen);
   display_broadway = GDK_DISPLAY_BROADWAY (GDK_SCREEN_DISPLAY (screen));
 
-
   impl = g_object_new (_gdk_window_impl_get_type (), NULL);
   private->impl = (GdkDrawable *)impl;
   impl->id = current_id++;
@@ -348,6 +344,8 @@ _gdk_window_impl_new (GdkWindow     *window,
 	    private->window_type == GDK_WINDOW_TEMP);
   g_assert (GDK_WINDOW_TYPE (private->parent) == GDK_WINDOW_ROOT);
 
+  display_broadway->toplevels = g_list_prepend (display_broadway->toplevels, impl);
+
   /* Instead of window manager placement we have this mini hack
      so that the main/first window is not covered in the demos. */
   if (impl->id > 1)



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