window-actor/x11: Freeze/thaw commits on actor freeze/thaw

When using Xwayland, if the damage get posted before the X11 window
manager/compositor has finished repainting the actors, the intermediate
state will show.

Make sure to hint Xwayland as to when it can post pending damages and
commit the Wayland buffer using the `freeze_commits()/thaw_commits()`
API, based on window actor freeze/thaw.

See-also: https://gitlab.gnome.org/GNOME/mutter/merge_requests/855
See-also: https://gitlab.freedesktop.org/xorg/xserver/merge_requests/316

https://gitlab.gnome.org/GNOME/mutter/merge_requests/942
This commit is contained in:
Olivier Fourdan 2019-11-19 14:30:44 +01:00
parent aa017383ac
commit d7a7af1ff2

View File

@ -98,6 +98,7 @@ struct _MetaWindowActorX11
gboolean needs_reshape; gboolean needs_reshape;
gboolean recompute_focused_shadow; gboolean recompute_focused_shadow;
gboolean recompute_unfocused_shadow; gboolean recompute_unfocused_shadow;
gboolean is_frozen;
}; };
static MetaCullableInterface *cullable_parent_iface; static MetaCullableInterface *cullable_parent_iface;
@ -1316,6 +1317,18 @@ static void
meta_window_actor_x11_set_frozen (MetaWindowActor *actor, meta_window_actor_x11_set_frozen (MetaWindowActor *actor,
gboolean frozen) gboolean frozen)
{ {
MetaWindowActorX11 *actor_x11 = META_WINDOW_ACTOR_X11 (actor);
MetaWindow *window = meta_window_actor_get_meta_window (actor);
if (actor_x11->is_frozen == frozen)
return;
actor_x11->is_frozen = frozen;
if (frozen)
meta_window_x11_freeze_commits (window);
else
meta_window_x11_thaw_commits (window);
} }
static void static void