[mutter] wayland: Make surface role vfunc better named



commit 36f2d5b0f13e96c9f512f8fff1d376671f50509a
Author: Jonas Ådahl <jadahl gmail com>
Date:   Fri Nov 25 14:38:28 2016 +0800

    wayland: Make surface role vfunc better named
    
    It checks whether a surface is on a given "logical monitor", not
    output. Output here is the Wayland name for the same thing, but should
    not be confused with MetaOutput.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777732

 src/wayland/meta-wayland-surface-role-cursor.c |    6 ++--
 src/wayland/meta-wayland-surface.c             |   26 ++++++++++++-----------
 src/wayland/meta-wayland-surface.h             |    4 +-
 3 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface-role-cursor.c b/src/wayland/meta-wayland-surface-role-cursor.c
index 121e9e5..8937fc2 100644
--- a/src/wayland/meta-wayland-surface-role-cursor.c
+++ b/src/wayland/meta-wayland-surface-role-cursor.c
@@ -177,8 +177,8 @@ cursor_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
 }
 
 static gboolean
-cursor_surface_role_is_on_output (MetaWaylandSurfaceRole *role,
-                                  MetaLogicalMonitor     *logical_monitor)
+cursor_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *role,
+                                           MetaLogicalMonitor     *logical_monitor)
 {
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (role);
@@ -271,7 +271,7 @@ meta_wayland_surface_role_cursor_class_init (MetaWaylandSurfaceRoleCursorClass *
   surface_role_class->assigned = cursor_surface_role_assigned;
   surface_role_class->pre_commit = cursor_surface_role_pre_commit;
   surface_role_class->commit = cursor_surface_role_commit;
-  surface_role_class->is_on_output = cursor_surface_role_is_on_output;
+  surface_role_class->is_on_logical_monitor = cursor_surface_role_is_on_logical_monitor;
 
   object_class->constructed = cursor_surface_role_constructed;
   object_class->dispose = cursor_surface_role_dispose;
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 90fa239..3323742 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -147,8 +147,8 @@ meta_wayland_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
                                   MetaWaylandPendingState *pending);
 
 static gboolean
-meta_wayland_surface_role_is_on_output (MetaWaylandSurfaceRole *surface_role,
-                                        MetaLogicalMonitor     *logical_monitor);
+meta_wayland_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
+                                                 MetaLogicalMonitor     *logical_monitor);
 
 static MetaWaylandSurface *
 meta_wayland_surface_role_get_toplevel (MetaWaylandSurfaceRole *surface_role);
@@ -1170,8 +1170,8 @@ set_surface_is_on_output (MetaWaylandSurface *surface,
 }
 
 static gboolean
-actor_surface_is_on_output (MetaWaylandSurfaceRole *surface_role,
-                            MetaLogicalMonitor     *logical_monitor)
+actor_surface_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
+                                     MetaLogicalMonitor     *logical_monitor)
 {
   MetaWaylandSurface *surface =
     meta_wayland_surface_role_get_surface (surface_role);
@@ -1187,7 +1187,7 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
   MetaWaylandOutput *wayland_output = value;
   MetaWaylandSurface *surface = user_data;
   MetaLogicalMonitor *logical_monitor;
-  gboolean is_on_output;
+  gboolean is_on_logical_monitor;
 
   g_assert (surface->role);
 
@@ -1198,8 +1198,10 @@ update_surface_output_state (gpointer key, gpointer value, gpointer user_data)
       return;
     }
 
-  is_on_output = meta_wayland_surface_role_is_on_output (surface->role, logical_monitor);
-  set_surface_is_on_output (surface, wayland_output, is_on_output);
+  is_on_logical_monitor =
+    meta_wayland_surface_role_is_on_logical_monitor (surface->role,
+                                                     logical_monitor);
+  set_surface_is_on_output (surface, wayland_output, is_on_logical_monitor);
 }
 
 static void
@@ -1924,14 +1926,14 @@ meta_wayland_surface_role_commit (MetaWaylandSurfaceRole  *surface_role,
 }
 
 static gboolean
-meta_wayland_surface_role_is_on_output (MetaWaylandSurfaceRole *surface_role,
-                                        MetaLogicalMonitor     *logical_monitor)
+meta_wayland_surface_role_is_on_logical_monitor (MetaWaylandSurfaceRole *surface_role,
+                                                 MetaLogicalMonitor     *logical_monitor)
 {
   MetaWaylandSurfaceRoleClass *klass;
 
   klass = META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role);
-  if (klass->is_on_output)
-    return klass->is_on_output (surface_role, logical_monitor);
+  if (klass->is_on_logical_monitor)
+    return klass->is_on_logical_monitor (surface_role, logical_monitor);
   else
     return FALSE;
 }
@@ -2066,7 +2068,7 @@ meta_wayland_surface_role_actor_surface_class_init (MetaWaylandSurfaceRoleActorS
 
   surface_role_class->assigned = actor_surface_assigned;
   surface_role_class->commit = actor_surface_commit;
-  surface_role_class->is_on_output = actor_surface_is_on_output;
+  surface_role_class->is_on_logical_monitor = actor_surface_is_on_logical_monitor;
 }
 
 static void
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index 1f4ecdd..36e066f 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -60,8 +60,8 @@ struct _MetaWaylandSurfaceRoleClass
                       MetaWaylandPendingState *pending);
   void (*commit) (MetaWaylandSurfaceRole  *surface_role,
                   MetaWaylandPendingState *pending);
-  gboolean (*is_on_output) (MetaWaylandSurfaceRole *surface_role,
-                            MetaLogicalMonitor     *logical_monitor);
+  gboolean (*is_on_logical_monitor) (MetaWaylandSurfaceRole *surface_role,
+                                     MetaLogicalMonitor     *logical_monitor);
   MetaWaylandSurface * (*get_toplevel) (MetaWaylandSurfaceRole *surface_role);
 };
 


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