From 71323a8b48f6f99798ca0090e1de76ad8e0a6cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 22 Feb 2020 20:08:37 +0100 Subject: [PATCH 1/2] wayland/popup: Remove unnecessary checks when mapping popup We only call this when we're not already mapped so don't check that. We also only call this when we should be mapped so don't check that either. --- gdk/wayland/gdksurface-wayland.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 2174bdf72a..e4fdae3122 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -2697,12 +2697,6 @@ gdk_wayland_surface_map_popup (GdkSurface *surface, GdkSurface *parent; GdkWaylandSeat *grab_input_seat; - if (!should_be_mapped (surface)) - return; - - if (impl->mapped) - return; - parent = surface->parent; if (!parent) { From f0b0076a1c51e15cd088bc4ceb73b7c598857728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 22 Feb 2020 20:09:38 +0100 Subject: [PATCH 2/2] wayland/popup: Emit un-withdrawn event earlier Otherwise grabbing the seat will appear to have failed. --- gdk/wayland/gdksurface-wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index e4fdae3122..d0fb6d8420 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -2719,6 +2719,8 @@ gdk_wayland_surface_map_popup (GdkSurface *surface, impl->popup.unconstrained_width = width; impl->popup.unconstrained_height = height; impl->mapped = TRUE; + + gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0); } static void @@ -2826,7 +2828,6 @@ gdk_wayland_surface_present_popup (GdkSurface *surface, if (impl->display_server.xdg_popup) { - gdk_synthesize_surface_state (surface, GDK_SURFACE_STATE_WITHDRAWN, 0); gdk_surface_invalidate_rect (surface, NULL); return TRUE; }