MetaWaylandPointerConstraint: Require 'appears-focused' to enable
Instead of relying on the keyboard focus surface, use the 'appears-focused' state of the corresponding MetaWindow to determine if a constraint should enable or not. https://bugzilla.gnome.org/show_bug.cgi?id=762661
This commit is contained in:
parent
b04747b174
commit
1c94d0e598
@ -368,13 +368,18 @@ is_within_constraint_region (MetaWaylandPointerConstraint *constraint,
|
|||||||
static void
|
static void
|
||||||
meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint)
|
meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint)
|
||||||
{
|
{
|
||||||
MetaWaylandSeat *seat = constraint->seat;
|
|
||||||
wl_fixed_t sx, sy;
|
wl_fixed_t sx, sy;
|
||||||
|
|
||||||
if (constraint->is_enabled)
|
if (constraint->is_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (seat->keyboard.focus_surface != constraint->surface)
|
if (!constraint->surface->window)
|
||||||
|
{
|
||||||
|
g_warn_if_reached ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!meta_window_appears_focused (constraint->surface->window))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
meta_wayland_pointer_get_relative_coordinates (&constraint->seat->pointer,
|
meta_wayland_pointer_get_relative_coordinates (&constraint->seat->pointer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user