mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
wayland/popup: Use maybe_notify_mapped() helper
This commit is contained in:
parent
9e6a55a086
commit
366b946f5b
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user