Skip to content

feat: add focus_first_tiled dispatcher - #1224

Open
EddieBrunstedt wants to merge 1 commit into
mangowm:mainfrom
EddieBrunstedt:feat/focusmaster
Open

feat: add focus_first_tiled dispatcher#1224
EddieBrunstedt wants to merge 1 commit into
mangowm:mainfrom
EddieBrunstedt:feat/focusmaster

Conversation

@EddieBrunstedt

Copy link
Copy Markdown

This adds a focus_first_tiled dispatcher that focuses the first visible tiled window in layout order on the focused monitor. In a master/stack layout that's the master window.

I tried scripting this over IPC first, but focusid doesn't warp the cursor, so with sloppyfocus the focus snaps back as soon as the mouse moves.

The window is picked with the same VISIBLEON/ISFAKETILED walk the layout code uses, so it agrees with whatever the layout puts first (after zoom, nmaster changes and so on) and skips floating windows. If there's no eligible window, or it's already focused, it does nothing, so the cursor never warps without reason.

I've been running this daily for about two weeks without issues.

I think this fits as core functionality, but no hard feelings if you see it differently.

Focus the first visible tiled client in layout order on the focused
monitor.

The client is selected using the same VISIBLEON/ISFAKETILED traversal
used by Mango's layout engine, so the action behaves consistently
across layouts and follows ordering changes made by actions such as
zoom. Floating and otherwise ineligible clients are skipped.

Do nothing when no eligible client exists or when it is already
focused, avoiding unnecessary cursor warping.
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