After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730541 - Focus-follows-mouse mode is broken
Focus-follows-mouse mode is broken
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-05-21 20:13 UTC by Florian Müllner
Modified: 2014-05-21 20:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Fix delayed mouse mode (1.59 KB, patch)
2014-05-21 20:14 UTC, Florian Müllner
committed Details | Review
window: Fix delayed mouse mode on X (2.58 KB, patch)
2014-05-21 20:14 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2014-05-21 20:13:59 UTC
Since commit 18d609ad6da3de, delayed focus switches are broken on both X and wayland. Attached patches fix both.
Comment 1 Florian Müllner 2014-05-21 20:14:02 UTC
Created attachment 276950 [details] [review]
window: Fix delayed mouse mode

Using clutter_actor_has_pointer() to test whether the pointer is
on the window makes for clean and nice-looking code, but does not
work in practice - ClutterActor:has-pointer is not recursive, so
we miss when the pointer is on the associated surface actor rather
than the actor itself.
Instead, check whether the window actor contains the core pointer's
pointer actor, which actually works.
Comment 2 Florian Müllner 2014-05-21 20:14:08 UTC
Created attachment 276951 [details] [review]
window: Fix delayed mouse mode on X

On X, basing the check whether the pointer is on the window on
Clutter events does not work, as the relevant events are handled
by GDK instead.
So add an X-specific window_has_pointer() implementation to also
fix mouse mode when running as X compositor.
Comment 3 Jasper St. Pierre (not reading bugmail) 2014-05-21 20:41:34 UTC
Review of attachment 276950 [details] [review]:

Whoops.

::: src/core/window.c
@@ +7707,3 @@
+
+  dm = clutter_device_manager_get_default ();
+  dev = clutter_device_manager_get_core_device (dm, CLUTTER_POINTER_DEVICE);

get_core_device makes a round-trip to the X server. I'd prefer get_device (META_VIRTUAL_CORE_POINTER_ID);
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-05-21 20:42:36 UTC
Review of attachment 276951 [details] [review]:

::: src/core/window.c
@@ +7702,3 @@
 window_has_pointer (MetaWindow *window)
 {
+  if (meta_is_wayland_compositor ())

Could you split this into window_has_pointer_x11 and window_has_pointer_wayland ?
Comment 5 Florian Müllner 2014-05-21 20:44:04 UTC
(In reply to comment #3)
> get_core_device makes a round-trip to the X server.

When running as wayland compositor?


(In reply to comment #4)
> Could you split this into window_has_pointer_x11 and window_has_pointer_wayland
> ?

Sure.
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-05-21 20:48:38 UTC
(In reply to comment #5)
> When running as wayland compositor?

... d'oh. Yeah, I guess just leave it as is.
Comment 7 Florian Müllner 2014-05-21 20:57:58 UTC
Attachment 276950 [details] pushed as f159611 - window: Fix delayed mouse mode
Attachment 276951 [details] pushed as f38c1f6 - window: Fix delayed mouse mode on X

Pushed with the suggested function split.