[gtk+] wayland: check parent surface for subsurface
- From: Olivier Fourdan <ofourdan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: check parent surface for subsurface
- Date: Fri, 2 Jun 2017 13:48:51 +0000 (UTC)
commit 08aade4b7c4ff011402aada4270a6c4260d30958
Author: Olivier Fourdan <ofourdan redhat com>
Date: Tue May 16 16:13:34 2017 +0200
wayland: check parent surface for subsurface
When an event is received while a tooltip is showing, the GtkTooltip's
event handling code can end up calling gdk_window_set_transient_for()
from gtk_tooltip_set_last_window().
The Wayland GDK backend will try to automatically create a subsurface
in gdk_wayland_window_set_transient_for() but if the parent surface is
gone meanwhile, this will will cause a crash when trying to create a
subsurface from a parent with a null surface.
Checking for the parent is not sufficient, we ought to check for the
parent surface as well to avoid the crash.
https://bugzilla.gnome.org/show_bug.cgi?id=782283
gdk/wayland/gdkwindow-wayland.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 95b74df..6e78de8 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1312,7 +1312,7 @@ gdk_wayland_window_create_subsurface (GdkWindow *window)
if (impl->transient_for)
parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
- if (parent_impl)
+ if (parent_impl && parent_impl->display_server.wl_surface)
{
display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
impl->display_server.wl_subsurface =
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]