1
0
Fork 0

wayland/surface: Rename "should_cache_state" to "is_synchronized"

Also remove the stale meta_wayland_surface_is_effectively_synchronized
prototype.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880>
This commit is contained in:
Michel Dänzer 2021-06-05 16:46:56 +02:00 committed by Michel Dänzer
parent e7d589d45b
commit a99198de83
3 changed files with 13 additions and 21 deletions

View file

@ -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);

View file

@ -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

View file

@ -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);