diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index 2f227dcd3f..c992ff4214 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -2948,6 +2948,19 @@ is_relayout_finished (GdkSurface *surface) return TRUE; } +static void +maybe_notify_mapped (GdkSurface *surface) +{ + if (surface->destroyed) + return; + + if (!GDK_SURFACE_IS_MAPPED (surface)) + { + gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0); + gdk_surface_invalidate_rect (surface, NULL); + } +} + static void gdk_wayland_surface_map_popup (GdkSurface *surface, int width, @@ -2983,7 +2996,7 @@ gdk_wayland_surface_map_popup (GdkSurface *surface, impl->popup.unconstrained_height = height; impl->mapped = TRUE; - gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0); + maybe_notify_mapped (surface); } static void @@ -4736,19 +4749,6 @@ gdk_wayland_toplevel_class_init (GdkWaylandToplevelClass *class) gdk_toplevel_install_properties (object_class, 1); } -static void -maybe_notify_mapped (GdkSurface *surface) -{ - if (surface->destroyed) - return; - - if (!GDK_SURFACE_IS_MAPPED (surface)) - { - gdk_synthesize_surface_state (surface, GDK_TOPLEVEL_STATE_WITHDRAWN, 0); - gdk_surface_invalidate_rect (surface, NULL); - } -} - static void reconfigure_callback (void *data, struct wl_callback *callback,