From a99198de83150e1598dd8152b99fe745e5405e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 5 Jun 2021 16:46:56 +0200 Subject: [PATCH] wayland/surface: Rename "should_cache_state" to "is_synchronized" Also remove the stale meta_wayland_surface_is_effectively_synchronized prototype. Part-of: --- src/wayland/meta-wayland-subsurface.c | 16 +++++----------- src/wayland/meta-wayland-surface.c | 12 ++++++------ src/wayland/meta-wayland-surface.h | 6 ++---- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c index 6a23c8610..6a50b3299 100644 --- a/src/wayland/meta-wayland-subsurface.c +++ b/src/wayland/meta-wayland-subsurface.c @@ -105,12 +105,6 @@ is_sibling (MetaWaylandSurface *surface, return surface != sibling && surface->sub.parent == sibling->sub.parent; } -static gboolean -is_surface_effectively_synchronized (MetaWaylandSurface *surface) -{ - return meta_wayland_surface_should_cache_state (surface); -} - void meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface) { @@ -127,7 +121,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface) surface->sub.pending_pos = FALSE; } - if (is_surface_effectively_synchronized (surface)) + if (meta_wayland_surface_is_synchronized (surface)) meta_wayland_surface_apply_cached_state (surface); meta_wayland_actor_surface_sync_actor_state (actor_surface); @@ -194,7 +188,7 @@ meta_wayland_subsurface_get_toplevel (MetaWaylandSurfaceRole *surface_role) } static gboolean -meta_wayland_subsurface_should_cache_state (MetaWaylandSurfaceRole *surface_role) +meta_wayland_subsurface_is_synchronized (MetaWaylandSurfaceRole *surface_role) { MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); @@ -205,7 +199,7 @@ meta_wayland_subsurface_should_cache_state (MetaWaylandSurfaceRole *surface_role parent = surface->sub.parent; if (parent) - return meta_wayland_surface_should_cache_state (parent); + return meta_wayland_surface_is_synchronized (parent); return TRUE; } @@ -276,7 +270,7 @@ meta_wayland_subsurface_class_init (MetaWaylandSubsurfaceClass *klass) surface_role_class->assigned = meta_wayland_subsurface_assigned; surface_role_class->get_toplevel = meta_wayland_subsurface_get_toplevel; - surface_role_class->should_cache_state = meta_wayland_subsurface_should_cache_state; + surface_role_class->is_synchronized = meta_wayland_subsurface_is_synchronized; surface_role_class->notify_subsurface_state_changed = meta_wayland_subsurface_notify_subsurface_state_changed; @@ -455,7 +449,7 @@ wl_subsurface_set_desync (struct wl_client *client, return; is_parent_effectively_synchronized = - is_surface_effectively_synchronized (surface->sub.parent); + meta_wayland_surface_is_synchronized (surface->sub.parent); if (!is_parent_effectively_synchronized) meta_wayland_surface_apply_cached_state (surface); diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 7b3a02ad4..803a3e179 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -1023,7 +1023,7 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface) * 2) Its mode changes from synchronized to desynchronized and its parent * surface is in effective desynchronized mode. */ - if (meta_wayland_surface_should_cache_state (surface)) + if (meta_wayland_surface_is_synchronized (surface)) { ensure_cached_state (surface); @@ -1985,24 +1985,24 @@ meta_wayland_surface_get_window (MetaWaylandSurface *surface) } static gboolean -meta_wayland_surface_role_should_cache_state (MetaWaylandSurfaceRole *surface_role) +meta_wayland_surface_role_is_synchronized (MetaWaylandSurfaceRole *surface_role) { MetaWaylandSurfaceRoleClass *klass; klass = META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role); - if (klass->should_cache_state) - return klass->should_cache_state (surface_role); + if (klass->is_synchronized) + return klass->is_synchronized (surface_role); else return FALSE; } gboolean -meta_wayland_surface_should_cache_state (MetaWaylandSurface *surface) +meta_wayland_surface_is_synchronized (MetaWaylandSurface *surface) { if (!surface->role) return FALSE; - return meta_wayland_surface_role_should_cache_state (surface->role); + return meta_wayland_surface_role_is_synchronized (surface->role); } static void diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 757de17d1..34d771324 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -63,7 +63,7 @@ struct _MetaWaylandSurfaceRoleClass gboolean (*is_on_logical_monitor) (MetaWaylandSurfaceRole *surface_role, MetaLogicalMonitor *logical_monitor); MetaWaylandSurface * (*get_toplevel) (MetaWaylandSurfaceRole *surface_role); - gboolean (*should_cache_state) (MetaWaylandSurfaceRole *surface_role); + gboolean (*is_synchronized) (MetaWaylandSurfaceRole *surface_role); void (*notify_subsurface_state_changed) (MetaWaylandSurfaceRole *surface_role); void (*get_relative_coordinates) (MetaWaylandSurfaceRole *surface_role, float abs_x, @@ -268,8 +268,6 @@ MetaWaylandSurfaceState * void meta_wayland_surface_apply_cached_state (MetaWaylandSurface *surface); -gboolean meta_wayland_surface_is_effectively_synchronized (MetaWaylandSurface *surface); - gboolean meta_wayland_surface_assign_role (MetaWaylandSurface *surface, GType role_type, const char *first_property_name, @@ -307,7 +305,7 @@ MetaWaylandSurface *meta_wayland_surface_get_toplevel (MetaWaylandSurface *surfa META_EXPORT_TEST MetaWindow * meta_wayland_surface_get_window (MetaWaylandSurface *surface); -gboolean meta_wayland_surface_should_cache_state (MetaWaylandSurface *surface); +gboolean meta_wayland_surface_is_synchronized (MetaWaylandSurface *surface); MetaWindow * meta_wayland_surface_get_toplevel_window (MetaWaylandSurface *surface);