Skip to content

fix: keep focus on hover working while a click-through overlay is on screen - #595

Open
rpmcruz wants to merge 1 commit into
forge-ext:mainfrom
rpmcruz:fix/focus-on-hover-overlay
Open

rpmcruz wants to merge 1 commit into
forge-ext:mainfrom
rpmcruz:fix/focus-on-hover-overlay

Conversation

@rpmcruz

@rpmcruz rpmcruz commented Nov 12, 2026 •

Copy link
Copy Markdown

Problem. With focus on hover enabled, hover stops focusing windows for as long as an override-redirect window covers the pointer. Gromit-MPX, for example, keeps a full-screen, click-through overlay of this kind while it runs. _getMetaWindowAtPointer() returns the topmost window actor whose frame rect contains the pointer, so it returns that overlay everywhere. focus() and raise() then fail on it on every 16 ms tick (meta_window_focus: assertion '!window->override_redirect' failed, and the same for meta_window_raise), and no other window gets focused. Hover only works again once the overlay goes away (for Gromit-MPX, when it quits), which looks like "focus on hover stopped working until reboot". I have found it through assertions in my journal, which started whenever Gromit-MPX started.

I think #483 (hover to focus breaks password dialogs) is the same problem: the frame-rect lookup ignores the shell's own UI, so the loop keeps focusing the window under a shell dialog. With the pick, the dialog is what is under the pointer and the focus is left alone. I haven't tested that case.

Change. _getMetaWindowAtPointer() now picks the stage at the pointer (global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y)) and walks up to the Meta.WindowActor. The pick honours input regions and only sees visible actors, so it returns the window that actually receives the pointer, and a click-through overlay no longer hides the window under it. Over an override-redirect window that does take input (a menu, a tooltip, Gromit-MPX while drawing), or over the shell's own UI, it returns null and the focus is left as it is.

…screen

_getMetaWindowAtPointer() returned the topmost window actor whose frame
rect contained the pointer, so a full-screen override-redirect overlay
(such as Gromit-MPX's) was returned everywhere: focus() and raise()
failed on it every tick and no other window got focused until the
overlay went away. Pick the stage instead, which honours input regions
and visibility, and leave the focus alone over override-redirect
windows and the shell's own UI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011EQfDZWMqKsLxtjj8ySMi1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant