[gtk+/client-side-windows: 204/284] Sync the display when creating a native window.



commit e631d2d2d45286a2b50ca82b3c12a963583d9e4e
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jan 29 17:36:17 2009 +0100

    Sync the display when creating a native window.
    
    This is needed because we want to be able to use the xid immediately
    even from another process or another connection to the display.
---
 gdk/gdkwindow.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 102fc90..b442865 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1305,6 +1305,12 @@ gdk_window_set_has_native (GdkWindow *window, gboolean has_native)
 
       if (gdk_window_is_viewable (window))
 	GDK_WINDOW_IMPL_GET_IFACE (private->impl)->show (window);
+
+      /* We sync here to ensure the window is created in the Xserver when
+       * this function returns. This is required because the returned XID
+       * for this window must be valid immediately, even with another
+       * connection to the Xserver */
+      gdk_display_sync (gdk_drawable_get_display (window));
     }
   else
     {



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