[gtk+] GdkWindowX11: the root window is not a toplevel



commit 69d42639b2c3bb6637402a82448c0db39f24d858
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Feb 16 11:54:12 2013 -0500

    GdkWindowX11: the root window is not a toplevel
    
    The macros we had for checking for toplevel windows were passing
    through the root window, which was not intentional and meant that
    for the root window WINDOW_IS_TOPLEVEL() returned TRUE but
    window->impl->toplevel was NULL, causing gdk_window_create_cairo_surface()
    to crash.

 gdk/x11/gdkwindow-x11.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 4f30287..26eaf69 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -111,14 +111,14 @@ static void     gdk_window_x11_set_background     (GdkWindow      *window,
 
 static void        gdk_window_impl_x11_finalize   (GObject            *object);
 
-#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
-  (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&   \
-   GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
-
-#define WINDOW_IS_TOPLEVEL(window)                  \
-  (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD &&   \
-   GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN && \
-   GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
+#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window)           \
+  (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL ||   \
+   GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP ||       \
+   GDK_WINDOW_TYPE (window) == GDK_WINDOW_FOREIGN)
+
+#define WINDOW_IS_TOPLEVEL(window)                      \
+  (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL ||   \
+   GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
 
 /* Return whether time1 is considered later than time2 as far as xserver
  * time is concerned.  Accounts for wraparound.


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