[gtk+/wip/otte/vulkan: 3/28] x11: Don't make random windows native



commit ea6e46dbbe3fc8a14978e9da38ab02443b56f38d
Author: Benjamin Otte <otte redhat com>
Date:   Mon Dec 5 23:40:16 2016 +0100

    x11: Don't make random windows native
    
    Instead, complain if somebody calls gdk_x11_window_get_xid() on a
    non-native window.
    
    We cannot make random windows native anymore because there's no GSK
    renderer associated with them, so we cannot draw them.

 gdk/x11/gdkwindow-x11.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index c339a9d..b2eb6ee 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -5150,19 +5150,8 @@ gdk_x11_get_server_time (GdkWindow *window)
 XID
 gdk_x11_window_get_xid (GdkWindow *window)
 {
-  /* Try to ensure the window has a native window */
-  if (!_gdk_window_has_impl (window))
-    {
-      gdk_window_ensure_native (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_window_get_display (window));
-    }
-  
-  if (!GDK_WINDOW_IS_X11 (window))
+  if (!GDK_WINDOW_IS_X11 (window) ||
+      !_gdk_window_has_impl (window))
     {
       g_warning (G_STRLOC " drawable is not a native X11 window");
       return None;
@@ -5200,11 +5189,8 @@ void
 gdk_x11_window_set_frame_sync_enabled (GdkWindow *window,
                                        gboolean   frame_sync_enabled)
 {
-  /* Try to ensure the window has a native window */
-  if (!_gdk_window_has_impl (window))
-    gdk_window_ensure_native (window);
-
-  if (!GDK_WINDOW_IS_X11 (window))
+  if (!GDK_WINDOW_IS_X11 (window) ||
+      !_gdk_window_has_impl (window))
     {
       g_warning (G_STRLOC " drawable is not a native X11 window");
       return;


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