surface: Add API to check whether initial commit has been done
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3825>
This commit is contained in:
parent
c3cfd5266a
commit
5ed0245c5c
2 changed files with 13 additions and 0 deletions
|
@ -200,6 +200,7 @@ struct _MetaWaylandSurface
|
|||
GNode *subsurface_leaf_node;
|
||||
MetaMultiTexture *texture;
|
||||
int scale;
|
||||
gboolean is_valid;
|
||||
} applied_state, committed_state;
|
||||
|
||||
/* Extension resources. */
|
||||
|
@ -433,6 +434,8 @@ meta_wayland_surface_state_new (void)
|
|||
}
|
||||
gboolean meta_wayland_surface_is_xwayland (MetaWaylandSurface *surface);
|
||||
|
||||
gboolean meta_wayland_surface_has_initial_commit (MetaWaylandSurface *surface);
|
||||
|
||||
static inline GNode *
|
||||
meta_get_next_subsurface_sibling (GNode *n)
|
||||
{
|
||||
|
|
|
@ -762,6 +762,8 @@ meta_wayland_surface_apply_state (MetaWaylandSurface *surface,
|
|||
|
||||
g_signal_emit (surface, surface_signals[SURFACE_PRE_STATE_APPLIED], 0);
|
||||
|
||||
surface->applied_state.is_valid = surface->committed_state.is_valid;
|
||||
|
||||
if (surface->role)
|
||||
{
|
||||
meta_wayland_surface_role_pre_apply_state (surface->role, state);
|
||||
|
@ -971,6 +973,8 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface)
|
|||
COGL_TRACE_BEGIN_SCOPED (MetaWaylandSurfaceCommit,
|
||||
"Meta::WaylandSurface::commit()");
|
||||
|
||||
surface->committed_state.is_valid = TRUE;
|
||||
|
||||
if (pending->scale > 0)
|
||||
surface->committed_state.scale = pending->scale;
|
||||
|
||||
|
@ -2657,3 +2661,9 @@ meta_wayland_surface_get_main_monitor (MetaWaylandSurface *surface)
|
|||
{
|
||||
return surface->main_monitor;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_surface_has_initial_commit (MetaWaylandSurface *surface)
|
||||
{
|
||||
return surface->committed_state.is_valid;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue