Skip to content

hyprland: add focus follows mouse toggle - #3755

Merged
purian23 merged 1 commit into
duxlabs-dev:masterfrom
Perdixky:feat/hyprland-focus-follows-mouse
Oct 12, 2026
Merged

purian23 merged 1 commit into
duxlabs-dev:masterfrom
Perdixky:feat/hyprland-focus-follows-mouse

Conversation

@Perdixky

Copy link
Copy Markdown
Contributor

Description

Add Focus follows mouse to Settings → Input → Mouse & touchpad on Hyprland. Enabling writes follow_mouse = 1; disabling writes follow_mouse = 0 through the existing DMS input Lua generator and reload flow.

An untouched setting inherits the current compositor mode instead of changing existing configurations. Reset removes the override. Read the live mode at startup and on configreloaded, without polling. Hide the row when the option is unsupported and require the existing writable input include and active Lua config.

This controls input:follow_mouse only. Hyprland's independent input:float_switch_override_focus can still change focus between tiled and floating windows when the toggle is off; that behavior was checked locally and is documented, but is outside this change.

Three new tests cover generated overrides, live mode reads, and persistence/reset. Regenerate the settings search index; leave translation catalogs to the maintainer sync.

AI disclosure: a meaningful part of the implementation and this description was generated with OpenAI Codex. The submitted diff was reviewed and tested locally.

Type of change

  • New feature (non-breaking change that adds functionality)

Screenshots / video

Local preview on Hyprland 0.56.2. The screenshot includes a local Chinese translation of the two new strings; translation catalog edits are not part of this PR.

Focus follows mouse in Mouse & touchpad settings

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally: make test-qml passes (300 logic tests, including 3 new tests, and 64 Qt tests). Built and ran the shell locally; checked the saved setting and effective follow_mouse option.
  • New user-facing strings are wrapped in I18n.tr() with translator context
  • QML changes: make lint-qml passes (3 entrypoints); git diff --check passes
  • Corresponding documentation PR: docs: explain hyprland focus follows mouse toggle dux-docs#164

No Go changes.

@apollo79

Copy link
Copy Markdown
Member

There is similar controls for other wms, niri being the one I use which has a focus_follows_mouse setting. If this gets added for hyprland, implementations for other compositors should be added for completeness and feature parity across compositors.

@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: follow_mouse Lua generation and -1 inherit/reset path, live mode read via hyprctl getoption on startup/configreloaded/compositor switch, toggle enable/visibility gating, settings spec and persistence, I18n strings, tests. Model: claude-opus-5-5.

@Perdixky

Copy link
Copy Markdown
Contributor Author

There is similar controls for other wms, niri being the one I use which has a focus_follows_mouse setting. If this gets added for hyprland, implementations for other compositors should be added for completeness and feature parity across compositors.

Agreed, but I only have hyprland in my env, so may need help from the community😊

@purian23

Copy link
Copy Markdown
Member

This looks good, thanks for the PR! I will have a follow up parity option on mango and niri inbound.

@purian23
purian23 merged commit 80ca0f0 into duxlabs-dev:master Oct 12, 2026
2 checks passed
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.

4 participants