[gtk+] window: Fail if the parent window and the visual don't match



commit 8f96966178dd14d1d625df991d2bdf85e431dfa3
Author: Benjamin Otte <otte redhat com>
Date:   Thu Sep 27 13:42:10 2012 +0200

    window: Fail if the parent window and the visual don't match
    
    They must be on the same screen.

 gdk/gdkwindow.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ae77620..206edc3 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1363,6 +1363,11 @@ gdk_window_new (GdkWindow     *parent,
       return NULL;
     }
 
+  if (attributes_mask & GDK_WA_VISUAL)
+    {
+      g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
+    }
+
   display = gdk_screen_get_display (screen);
 
   window = _gdk_display_create_window (display);



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