GNOME Bugzilla – Bug 730541
Focus-follows-mouse mode is broken
Last modified: 2014-05-21 20:58:09 UTC
Since commit 18d609ad6da3de, delayed focus switches are broken on both X and wayland. Attached patches fix both.
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.
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.
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);
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 ?
(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.
(In reply to comment #5) > When running as wayland compositor? ... d'oh. Yeah, I guess just leave it as is.
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.