[gtk+] [broadway] When resyncing, first create all windows then set attributes



commit ddcbd8234b8fd78b8736a2cbeacc6c4769e83c22
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Apr 11 17:49:18 2011 +0200

    [broadway] When resyncing, first create all windows then set attributes
    
    Some attributes (like transient parent) depende on other windows being
    there, so we create all first.

 gdk/broadway/gdkwindow-broadway.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 1cd5425..34a1ae6 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -208,6 +208,7 @@ _gdk_broadway_resync_windows (void)
 
   display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
 
+  /* First create all windows */
   for (l = display->toplevels; l != NULL; l = l->next)
     {
       GdkWindowImplBroadway *impl = l->data;
@@ -227,6 +228,16 @@ _gdk_broadway_resync_windows (void)
 				   window->width,
 				   window->height,
 				   window->window_type == GDK_WINDOW_TEMP);
+    }
+
+  /* Then do everything that may reference other windows */
+  for (l = display->toplevels; l != NULL; l = l->next)
+    {
+      GdkWindowImplBroadway *impl = l->data;
+
+      if (impl->id == 0)
+	continue; /* Skip root */
+
       if (impl->transient_for)
 	broadway_output_set_transient_for (display->output, impl->id, impl->transient_for);
       /* Can't check GDK_WINDOW_IS_MAPPED here, because that doesn't correctly handle



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