[gtk: 2/88] wayland/popup: Use maybe_notify_mapped() helper




commit 366b946f5b8bbb26972a542e3505833753fc6fc5
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Thu Nov 19 10:43:22 2020 +0100

    wayland/popup: Use maybe_notify_mapped() helper

 gdk/wayland/gdksurface-wayland.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
---
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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]