mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
wayland/pointer-constraints: Move window-unmanaging check
We should never enable a pointer constraint for an unmanaging window. https://bugzilla.gnome.org/show_bug.cgi?id=771345
This commit is contained in:
parent
98f0578f9d
commit
32276cf418
@ -131,9 +131,6 @@ appears_focused_changed (MetaWindow *window,
|
||||
meta_wayland_pointer_constraint_maybe_remove_for_seat (wayland_compositor->seat,
|
||||
window);
|
||||
|
||||
if (window->unmanaging)
|
||||
return;
|
||||
|
||||
meta_wayland_pointer_constraint_maybe_enable_for_window (window);
|
||||
}
|
||||
|
||||
@ -444,6 +441,7 @@ is_within_constraint_region (MetaWaylandPointerConstraint *constraint,
|
||||
static void
|
||||
meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint)
|
||||
{
|
||||
MetaWindow *window;
|
||||
wl_fixed_t sx, sy;
|
||||
|
||||
if (constraint->is_enabled)
|
||||
@ -452,7 +450,8 @@ meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *cons
|
||||
if (constraint->seat->pointer->focus_surface != constraint->surface)
|
||||
return;
|
||||
|
||||
if (!constraint->surface->window)
|
||||
window = constraint->surface->window;
|
||||
if (!window)
|
||||
{
|
||||
/*
|
||||
* Locks from Xwayland may come before we have had the opportunity to
|
||||
@ -462,6 +461,9 @@ meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *cons
|
||||
return;
|
||||
}
|
||||
|
||||
if (window->unmanaging)
|
||||
return;
|
||||
|
||||
if (meta_xwayland_is_xwayland_surface (constraint->surface))
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
@ -486,7 +488,7 @@ meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *cons
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!meta_window_appears_focused (constraint->surface->window))
|
||||
if (!meta_window_appears_focused (window))
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user