mirror of
https://github.com/brl/mutter.git
synced 2025-02-10 18:34:09 +00:00
wayland/surface: Add role commit_state callback
Which gets called when pending state is committed for the surface. This callback may amend the pending transaction or surface state as needed. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880>
This commit is contained in:
parent
79dc41499d
commit
9ed6a3dffb
@ -114,6 +114,11 @@ guint surface_signals[N_SURFACE_SIGNALS] = { 0 };
|
|||||||
static void
|
static void
|
||||||
meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role);
|
meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role);
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_surface_role_commit_state (MetaWaylandSurfaceRole *surface_role,
|
||||||
|
MetaWaylandTransaction *transaction,
|
||||||
|
MetaWaylandSurfaceState *pending);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_surface_role_pre_apply_state (MetaWaylandSurfaceRole *surface_role,
|
meta_wayland_surface_role_pre_apply_state (MetaWaylandSurfaceRole *surface_role,
|
||||||
MetaWaylandSurfaceState *pending);
|
MetaWaylandSurfaceState *pending);
|
||||||
@ -1023,6 +1028,9 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
|||||||
else
|
else
|
||||||
transaction = meta_wayland_transaction_new (surface->compositor);
|
transaction = meta_wayland_transaction_new (surface->compositor);
|
||||||
|
|
||||||
|
if (surface->role)
|
||||||
|
meta_wayland_surface_role_commit_state (surface->role, transaction, pending);
|
||||||
|
|
||||||
meta_wayland_transaction_merge_pending_state (transaction, surface);
|
meta_wayland_transaction_merge_pending_state (transaction, surface);
|
||||||
|
|
||||||
META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (&surface->protocol_state,
|
META_WAYLAND_SURFACE_FOREACH_SUBSURFACE (&surface->protocol_state,
|
||||||
@ -1952,6 +1960,18 @@ meta_wayland_surface_role_assigned (MetaWaylandSurfaceRole *surface_role)
|
|||||||
META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role)->assigned (surface_role);
|
META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role)->assigned (surface_role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_surface_role_commit_state (MetaWaylandSurfaceRole *surface_role,
|
||||||
|
MetaWaylandTransaction *transaction,
|
||||||
|
MetaWaylandSurfaceState *pending)
|
||||||
|
{
|
||||||
|
MetaWaylandSurfaceRoleClass *klass;
|
||||||
|
|
||||||
|
klass = META_WAYLAND_SURFACE_ROLE_GET_CLASS (surface_role);
|
||||||
|
if (klass->commit_state)
|
||||||
|
klass->commit_state (surface_role, transaction, pending);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_wayland_surface_role_pre_apply_state (MetaWaylandSurfaceRole *surface_role,
|
meta_wayland_surface_role_pre_apply_state (MetaWaylandSurfaceRole *surface_role,
|
||||||
MetaWaylandSurfaceState *pending)
|
MetaWaylandSurfaceState *pending)
|
||||||
|
@ -54,6 +54,9 @@ struct _MetaWaylandSurfaceRoleClass
|
|||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
void (*assigned) (MetaWaylandSurfaceRole *surface_role);
|
void (*assigned) (MetaWaylandSurfaceRole *surface_role);
|
||||||
|
void (*commit_state) (MetaWaylandSurfaceRole *surface_role,
|
||||||
|
MetaWaylandTransaction *transaction,
|
||||||
|
MetaWaylandSurfaceState *pending);
|
||||||
void (*pre_apply_state) (MetaWaylandSurfaceRole *surface_role,
|
void (*pre_apply_state) (MetaWaylandSurfaceRole *surface_role,
|
||||||
MetaWaylandSurfaceState *pending);
|
MetaWaylandSurfaceState *pending);
|
||||||
void (*apply_state) (MetaWaylandSurfaceRole *surface_role,
|
void (*apply_state) (MetaWaylandSurfaceRole *surface_role,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user