Repository navigation
feat(focus): focus a window as soon as it opens - #186
Merged
Merged
Conversation
There was a problem hiding this comment.
Issues
1. Invalid Hyprland dispatcher call (FocusOnOpen.qml)
Hyprland.dispatch(`hl.dsp.focus({ window = "address:0x${address}" })`);Where did hl.dsp.focus come from? Hyprland is not a Lua runtime. Hyprland's IPC dispatcher for focusing a window is focuswindow.
Furthermore, Quickshell's Hyprland.dispatch() method takes (dispatcher, args). Passing a single synthetic command string will cause Hyprland's socket parser to treat the whole string as the dispatcher name and fail.
Change it to:
Hyprland.dispatch("focuswindow", `address:0x${address}`);
Member
Is it bozo |
Contributor
Author
|
let him learn he's still a beginner after all 🤣 |
LeVraiArdox
approved these changes
Nov 15, 2026
LeVraiArdox
left a comment
Member
There was a problem hiding this comment.
LGTM. I should train that AI with vaxry's bible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With
follow_mouse = 1, a newly opened window does not get focus until the mouse moves. If you open an app (launcher, dock, keybind) and leave the cursor where it is, focus stays on the window under the cursor.Change
FocusOnOpenservice: listens for Hyprland'sopenwindowevent and focuses the new window.interactions.focusOnOpen(defaulttrue) to turn it off.shell.qml.Testing
Tried on a Hyprland session: with a window already open under the cursor, opening a second one focuses it without touching the mouse. Not tested with special workspaces (scratchpad).