window-actor: Apply opacity once assigned a surface

Trying to update the opacity before the window actor get assigned a
surface will be ignored.

As result, the initial opacity set by X11 clients using the EWMH
property _NET_WM_WINDOW_OPACITY is not applied at first.

To avoid the issue, make sure to set the opacity once the window actor
has a surface assigned.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3513
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4170>
This commit is contained in:
Olivier Fourdan 2024-12-05 17:54:57 +01:00 committed by Marge Bot
parent 4e8da5304a
commit c4be3cd568

View File

@ -378,6 +378,7 @@ meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
priv->surface = g_object_ref_sink (surface_actor);
meta_window_actor_add_surface_actor (self, surface_actor);
meta_window_actor_update_opacity (self);
if (meta_window_actor_is_frozen (self))
meta_window_actor_set_frozen (self, TRUE);