window-actor: Add set_frozen
vfunc
Currently, the window actor freeze/thaw implementation sets the frozen state of the surface actor using `meta_surface_actor_set_frozen()`. If we want to expand that behavior to also freeze/thaw commits for X11 windows running on Xwayland, we need to have a specific vfunc to abstract that in the window actor specific implementation. https://gitlab.gnome.org/GNOME/mutter/merge_requests/942
This commit is contained in:
parent
c3c54e8ce6
commit
aa017383ac
4 changed files with 34 additions and 3 deletions
|
@ -26,6 +26,8 @@ struct _MetaWindowActorClass
|
|||
void (*pre_paint) (MetaWindowActor *actor);
|
||||
void (*post_paint) (MetaWindowActor *actor);
|
||||
void (*queue_destroy) (MetaWindowActor *actor);
|
||||
void (*set_frozen) (MetaWindowActor *actor,
|
||||
gboolean frozen);
|
||||
};
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -144,6 +144,12 @@ meta_window_actor_wayland_queue_destroy (MetaWindowActor *actor)
|
|||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_wayland_set_frozen (MetaWindowActor *actor,
|
||||
gboolean frozen)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_window_actor_wayland_get_paint_volume (ClutterActor *actor,
|
||||
ClutterPaintVolume *volume)
|
||||
|
@ -181,6 +187,7 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
|
|||
window_actor_class->pre_paint = meta_window_actor_wayland_pre_paint;
|
||||
window_actor_class->post_paint = meta_window_actor_wayland_post_paint;
|
||||
window_actor_class->queue_destroy = meta_window_actor_wayland_queue_destroy;
|
||||
window_actor_class->set_frozen = meta_window_actor_wayland_set_frozen;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1312,6 +1312,12 @@ meta_window_actor_x11_queue_destroy (MetaWindowActor *actor)
|
|||
remove_frame_messages_timer (actor_x11);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_x11_set_frozen (MetaWindowActor *actor,
|
||||
gboolean frozen)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_x11_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
|
@ -1481,6 +1487,7 @@ meta_window_actor_x11_class_init (MetaWindowActorX11Class *klass)
|
|||
window_actor_class->pre_paint = meta_window_actor_x11_pre_paint;
|
||||
window_actor_class->post_paint = meta_window_actor_x11_post_paint;
|
||||
window_actor_class->queue_destroy = meta_window_actor_x11_queue_destroy;
|
||||
window_actor_class->set_frozen = meta_window_actor_x11_set_frozen;
|
||||
|
||||
actor_class->paint = meta_window_actor_x11_paint;
|
||||
actor_class->get_paint_volume = meta_window_actor_x11_get_paint_volume;
|
||||
|
|
|
@ -251,6 +251,21 @@ meta_window_actor_is_frozen (MetaWindowActor *self)
|
|||
return priv->surface == NULL || priv->freeze_count > 0;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_set_frozen (MetaWindowActor *self,
|
||||
gboolean frozen)
|
||||
{
|
||||
MetaWindowActorPrivate *priv =
|
||||
meta_window_actor_get_instance_private (self);
|
||||
|
||||
if (meta_surface_actor_is_frozen (priv->surface) == frozen)
|
||||
return;
|
||||
|
||||
meta_surface_actor_set_frozen (priv->surface, frozen);
|
||||
|
||||
META_WINDOW_ACTOR_GET_CLASS (self)->set_frozen (self, frozen);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_freeze (MetaWindowActor *self)
|
||||
{
|
||||
|
@ -258,7 +273,7 @@ meta_window_actor_freeze (MetaWindowActor *self)
|
|||
meta_window_actor_get_instance_private (self);
|
||||
|
||||
if (priv->freeze_count == 0 && priv->surface)
|
||||
meta_surface_actor_set_frozen (priv->surface, TRUE);
|
||||
meta_window_actor_set_frozen (self, TRUE);
|
||||
|
||||
priv->freeze_count ++;
|
||||
}
|
||||
|
@ -273,7 +288,7 @@ meta_window_actor_sync_thawed_state (MetaWindowActor *self)
|
|||
priv->first_frame_state = DRAWING_FIRST_FRAME;
|
||||
|
||||
if (priv->surface)
|
||||
meta_surface_actor_set_frozen (priv->surface, FALSE);
|
||||
meta_window_actor_set_frozen (self, FALSE);
|
||||
|
||||
/* We sometimes ignore moves and resizes on frozen windows */
|
||||
meta_window_actor_sync_actor_geometry (self, FALSE);
|
||||
|
@ -312,7 +327,7 @@ meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
|
|||
priv->surface = g_object_ref_sink (surface_actor);
|
||||
|
||||
if (meta_window_actor_is_frozen (self))
|
||||
meta_surface_actor_set_frozen (priv->surface, TRUE);
|
||||
meta_window_actor_set_frozen (self, TRUE);
|
||||
else
|
||||
meta_window_actor_sync_thawed_state (self);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue