Skip to content

Support keyboard navigation over multiple monitors in multitasking view#2536

Merged
leolost2605 merged 12 commits intomainfrom
leolost/focusable
Apr 22, 2026
Merged

Support keyboard navigation over multiple monitors in multitasking view#2536
leolost2605 merged 12 commits intomainfrom
leolost/focusable

Conversation

@leolost2605
Copy link
Copy Markdown
Member

@leolost2605 leolost2605 commented Sep 17, 2025

Instead of manually handling keyboard focus where needed, do it like GTK does it with some adaptations.

We have the FocusController which is added to the "root" focusable of a focus tree (e.g. mtv or window overview).

Then we have the focusable class which is subclassed by the actors in the actor tree where focus is needed. The focusable handles deciding which implementor gets the focus based on the direction.

We now also hide the focus indicator after 5 seconds.

Fixes #2651
Fixes #2648

We can easily add navigation via Tab now too but I would leave that to a follow up

@leolost2605 leolost2605 changed the title Leolost/focusable Support keyboard navigation over multiple monitors in multitasking view Sep 17, 2025
@leolost2605 leolost2605 force-pushed the leolost/focusable branch 4 times, most recently from 919ea31 to 139ae2f Compare November 23, 2025 14:26
@leolost2605 leolost2605 marked this pull request as ready for review November 23, 2025 14:30
@leolost2605 leolost2605 requested a review from a team November 23, 2025 14:32
@leolost2605 leolost2605 force-pushed the leolost/focusable branch 2 times, most recently from d0aa36a to 6507c10 Compare November 26, 2025 15:26
@leolost2605 leolost2605 mentioned this pull request Nov 26, 2025
5 tasks
@danirabbit danirabbit moved this to Needs review in OS 8.1.0 Dec 1, 2025
@danirabbit danirabbit removed this from OS 8.1.0 Dec 15, 2025
@danirabbit danirabbit moved this to Needs review in OS 8.1.1 Dec 15, 2025
@danirabbit

This comment was marked as outdated.

@danirabbit danirabbit mentioned this pull request Jan 21, 2026
Comment thread lib/Gestures/WidgetTarget.vala
@leolost2605 leolost2605 force-pushed the leolost/focusable branch 2 times, most recently from 87170b0 to a57c179 Compare January 30, 2026 18:56
@leolost2605
Copy link
Copy Markdown
Member Author

@lenemter I've added two commits on top that rename focusable to widget and then actortarget to widget target. Let me know what you think!

@danirabbit danirabbit requested a review from lenemter February 2, 2026 19:54
@lenemter
Copy link
Copy Markdown
Member

lenemter commented Feb 2, 2026

@leolost2605 I think it would be better to leave ActorTarget as is, rename Focusable to Widget, and make Widget subclass ActorTarget. This way Widget uses gesture infrastructure, not the other way around. What do you think?

@danirabbit danirabbit added this to OS 9 Feb 5, 2026
@danirabbit danirabbit removed this from OS 8.1.1 Feb 5, 2026
@danirabbit danirabbit moved this to Needs Review in OS 9 Feb 5, 2026
@leolost2605 leolost2605 force-pushed the leolost/focusable branch 2 times, most recently from 2b063df to 31a0d8f Compare February 9, 2026 17:36
@leolost2605
Copy link
Copy Markdown
Member Author

For some reason when I hold down left/right arrows in with window focused and then release it, the left/right continues to be repeated

@lenemter Hmm I can't reproduce this but maybe I misunderstood. What I did is with two windows open in the multitaskingview hold arrow key right -> the right most window gets selected -> the bell plays on repeat because the key is held but we can't navigate further to the right -> as soon as I release the key the bell stops

We should check if actor is Widget and use property to store the data, since we don't use qdata anywhere else

Now that we have the widget i've even been thinking whether we should drop focuscontroller and introduce a Root subclass of widget which would handle the focus controller stuff and would then have the focus_visible property. That's how GTK does it with Gtk.Window. What do you think?

@leolost2605
Copy link
Copy Markdown
Member Author

@lenemter I updated it with a Root now

@leolost2605 leolost2605 requested a review from lenemter February 20, 2026 23:01
@leolost2605 leolost2605 force-pushed the leolost/focusable branch 2 times, most recently from 75bd177 to 79ad90b Compare March 9, 2026 16:31
@leolost2605 leolost2605 mentioned this pull request Mar 23, 2026
Comment thread lib/Widgets/Widget.vala Outdated
Comment thread lib/Widgets/Widget.vala
Comment thread lib/Widgets/Widget.vala
Comment thread lib/Widgets/Widget.vala
Comment thread lib/Widgets/FocusUtils.vala Outdated
@leolost2605 leolost2605 merged commit c83e418 into main Apr 22, 2026
6 checks passed
@leolost2605 leolost2605 deleted the leolost/focusable branch April 22, 2026 12:08
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in OS 9 Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Cannot select window by keyboard in multitasking view after workspace switching Pressing Esc doesn't close multitasking view

3 participants