From: Matthias Clasen Date: Fri, 6 Jan 2023 19:55:45 +0000 (-0500) Subject: More cleanups X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~8^2~92^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3574fde7709a777ef538c982ac9a37b6f629d69c;p=gtk4.git More cleanups --- diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index ee6d3c964b..149db0788a 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -68,9 +68,6 @@ static void gdk_wayland_surface_maybe_resize (GdkSurface *surface, static void gdk_wayland_surface_configure (GdkSurface *surface); -static void gdk_wayland_surface_show (GdkSurface *surface); -static void gdk_wayland_surface_hide (GdkSurface *surface); - static void gdk_wayland_surface_sync_shadow (GdkSurface *surface); static void gdk_wayland_surface_sync_input_region (GdkSurface *surface); static void gdk_wayland_surface_sync_opaque_region (GdkSurface *surface); @@ -351,17 +348,6 @@ on_frame_clock_before_paint (GdkFrameClock *clock, gdk_surface_apply_state_change (surface); } -static void -configure_drag_surface_geometry (GdkSurface *surface) -{ - GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - - gdk_wayland_surface_update_size (surface, - impl->next_layout.configured_width, - impl->next_layout.configured_height, - impl->scale); -} - static void gdk_wayland_surface_request_layout (GdkSurface *surface) { @@ -692,8 +678,7 @@ gdk_wayland_surface_maybe_resize (GdkSurface *surface, int scale) { GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - gboolean is_xdg_popup; - gboolean is_visible; + gboolean hide_temporarily; if (surface->width == width && surface->height == height && @@ -705,17 +690,17 @@ gdk_wayland_surface_maybe_resize (GdkSurface *surface, * the initial configure is received, so hide and show the surface again * force the new size onto the compositor. See bug #772505. */ + hide_temporarily = GDK_IS_WAYLAND_POPUP (surface) && + gdk_surface_get_mapped (surface) && + !impl->initial_configure_received; - is_xdg_popup = GDK_IS_WAYLAND_POPUP (surface); - is_visible = gdk_surface_get_mapped (surface); - - if (is_xdg_popup && is_visible && !impl->initial_configure_received) - gdk_wayland_surface_hide (surface); + if (hide_temporarily) + gdk_surface_hide (surface); gdk_wayland_surface_update_size (surface, width, height, scale); - if (is_xdg_popup && is_visible && !impl->initial_configure_received) - gdk_wayland_surface_show (surface); + if (hide_temporarily) + gdk_wayland_surface_create_wl_surface (surface); } static void @@ -977,33 +962,6 @@ gdk_wayland_surface_create_xdg_surface_resources (GdkSurface *surface) } } -static void -gdk_wayland_surface_map_toplevel (GdkSurface *surface) -{ - GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - - if (!GDK_IS_WAYLAND_TOPLEVEL (surface)) - return; - - if (impl->mapped) - return; - - gdk_wayland_surface_create_xdg_toplevel (GDK_WAYLAND_TOPLEVEL (surface)); - - impl->mapped = TRUE; -} - -static void -gdk_wayland_surface_show (GdkSurface *surface) -{ - GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - - if (!impl->display_server.wl_surface) - gdk_wayland_surface_create_wl_surface (surface); - - gdk_wayland_surface_map_toplevel (surface); -} - static void unmap_popups_for_surface (GdkSurface *surface) {