[mutter] MetaWaylandPointerConstraint: Require 'appears-focused' to enable
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] MetaWaylandPointerConstraint: Require 'appears-focused' to enable
- Date: Wed, 9 Mar 2016 06:32:50 +0000 (UTC)
commit 1c94d0e59818a39161faa503ebb41965b44c38ac
Author: Jonas Ådahl <jadahl gmail com>
Date: Thu Feb 25 11:15:29 2016 +0800
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
src/wayland/meta-wayland-pointer-constraints.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer-constraints.c b/src/wayland/meta-wayland-pointer-constraints.c
index a9f9a8d..48d3dd6 100644
--- a/src/wayland/meta-wayland-pointer-constraints.c
+++ b/src/wayland/meta-wayland-pointer-constraints.c
@@ -368,13 +368,18 @@ is_within_constraint_region (MetaWaylandPointerConstraint *constraint,
static void
meta_wayland_pointer_constraint_maybe_enable (MetaWaylandPointerConstraint *constraint)
{
- MetaWaylandSeat *seat = constraint->seat;
wl_fixed_t sx, sy;
if (constraint->is_enabled)
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;
meta_wayland_pointer_get_relative_coordinates (&constraint->seat->pointer,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]