[mutter] wayland/surface: Emit signal before applying state



commit 0cf98c564195fc240c94badc3a4457f674f70918
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Oct 24 11:34:18 2018 +0200

    wayland/surface: Emit signal before applying state
    
    Will be used to invalidate depending state that should be updated as
    part of a surface state being applied.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/907

 src/wayland/meta-wayland-surface.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 4122acc11..841a2d33d 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -96,6 +96,7 @@ enum
   SURFACE_SHORTCUTS_INHIBITED,
   SURFACE_SHORTCUTS_RESTORED,
   SURFACE_GEOMETRY_CHANGED,
+  SURFACE_PRE_STATE_APPLIED,
   N_SURFACE_SIGNALS
 };
 
@@ -650,6 +651,8 @@ meta_wayland_surface_apply_pending_state (MetaWaylandSurface      *surface,
 {
   gboolean had_damage = FALSE;
 
+  g_signal_emit (surface, surface_signals[SURFACE_PRE_STATE_APPLIED], 0);
+
   if (surface->role)
     {
       meta_wayland_surface_role_pre_commit (surface->role, pending);
@@ -1718,6 +1721,13 @@ meta_wayland_surface_class_init (MetaWaylandSurfaceClass *klass)
                   0, NULL, NULL,
                   g_cclosure_marshal_VOID__VOID,
                   G_TYPE_NONE, 0);
+  surface_signals[SURFACE_PRE_STATE_APPLIED] =
+    g_signal_new ("pre-state-applied",
+                  G_TYPE_FROM_CLASS (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  0, NULL, NULL,
+                  g_cclosure_marshal_VOID__VOID,
+                  G_TYPE_NONE, 0);
 }
 
 static void


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