mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
wayland: Check whether Xwayland window had a prior surface in generic code
Since commit 8df2a1452c
(As pointed out by Robert Mader) we just happened
do this check when doing the first lookup for a Wayland surface for a
XWayland window, when we are later notifying upon surface creation we just
set the relation with no further checks.
The cases pointed out in the comment (eg. window changing decoration) might
presumably happen in a quick enough sequence that we have two scheduled
associations on the fly, so move this check to the more generic
meta_xwayland_associate_window_with_surface() which is called on both
immediate and delayed paths.
https://gitlab.gnome.org/GNOME/mutter/issues/361
This commit is contained in:
parent
803ffc19a4
commit
8a9a78ec8a
@ -67,6 +67,16 @@ meta_xwayland_associate_window_with_surface (MetaWindow *window,
|
||||
{
|
||||
MetaDisplay *display = window->display;
|
||||
|
||||
/* If the window has an existing surface, like if we're
|
||||
* undecorating or decorating the window, then we need
|
||||
* to detach the window from its old surface.
|
||||
*/
|
||||
if (window->surface)
|
||||
{
|
||||
meta_wayland_surface_set_window (window->surface, NULL);
|
||||
window->surface = NULL;
|
||||
}
|
||||
|
||||
if (!meta_wayland_surface_assign_role (surface,
|
||||
META_TYPE_WAYLAND_SURFACE_ROLE_XWAYLAND,
|
||||
NULL))
|
||||
@ -97,16 +107,6 @@ associate_window_with_surface_id (MetaXWaylandManager *manager,
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
/* If the window has an existing surface, like if we're
|
||||
* undecorating or decorating the window, then we need
|
||||
* to detach the window from its old surface.
|
||||
*/
|
||||
if (window->surface)
|
||||
{
|
||||
meta_wayland_surface_set_window (window->surface, NULL);
|
||||
window->surface = NULL;
|
||||
}
|
||||
|
||||
resource = wl_client_get_object (manager->client, surface_id);
|
||||
if (resource)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user