diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-11-19 14:39:42 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-19 14:40:55 -0500 |
commit | 12a692ea9debe86212fa90396ff987b4cc7764d3 (patch) | |
tree | bc6abe58037321855a8a3aed28e472b204238c37 /gdk | |
parent | 029aad7907a2381e398a601d25907c39cf9b332b (diff) | |
download | gtk+-12a692ea9debe86212fa90396ff987b4cc7764d3.tar.gz |
wayland: Avoid a crash
We can end up in situations where NULL gets passed to
get_transient_parent(). Embrace it instead of avoiding it.
https://bugzilla.gnome.org/show_bug.cgi?id=758327
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 4df37f11b2..0834235b12 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1274,7 +1274,7 @@ should_map_as_popup (GdkWindow *window) static GdkWindow * get_popup_parent (GdkWindow *window) { - do + while (window) { GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); @@ -1283,7 +1283,6 @@ get_popup_parent (GdkWindow *window) window = impl->transient_for; } - while (window); return NULL; } @@ -1351,9 +1350,7 @@ gdk_wayland_window_map (GdkWindow *window) } if (transient_for) - transient_for = gdk_window_get_toplevel (transient_for); - if (transient_for) - transient_for = get_popup_parent (transient_for); + transient_for = get_popup_parent (gdk_window_get_toplevel (transient_for)); /* If the position was not explicitly set, start the popup at the * position of the device that holds the grab. |