[gtk+] Avoid a segfault when menus are re-shown under Wayland



commit 11ad337a29d84aa08b6087c95d0272112e6ce2cd
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Sep 16 19:01:48 2013 -0400

    Avoid a segfault when menus are re-shown under Wayland
    
    The surface is destroyed when we hide a window, but
    gdk_window_set_opaque_region can be called before the window is
    shown again, so we need to ensure the surface exits.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707328

 gdk/wayland/gdkwindow-wayland.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 937a8e8..5e001f1 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -2081,6 +2081,9 @@ gdk_wayland_window_set_opaque_region (GdkWindow      *window,
   if (GDK_WINDOW_DESTROYED (window))
     return;
 
+  if (!impl->surface)
+    gdk_wayland_window_create_surface (window);
+
   wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)), region);
   if (wl_region == NULL)
     return;


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