feat: add focused_only option for workspaces and taskbar widgets#3069
Open
joao-paulo-santos wants to merge 1 commit into
Open
feat: add focused_only option for workspaces and taskbar widgets#3069joao-paulo-santos wants to merge 1 commit into
joao-paulo-santos wants to merge 1 commit into
Conversation
53f253d to
e135f56
Compare
e135f56 to
6f9f56c
Compare
Collaborator
|
Thanks for the PR! |
Contributor
Author
On it, let me install Niri and setup the compositor to my liking and then test the PR branch there + rebase. |
6f9f56c to
a1c3ab8
Compare
Contributor
Author
|
Rebased and tested working on Niri |
a1c3ab8 to
6b1d154
Compare
New config option for the workspaces widget and taskbar widget: focused_only = false (default). When enabled, only the monitor with keyboard/pointer focus shows the active workspace highlight color. Other monitors show their active workspace as occupied color instead. For the workspaces widget, detects output focus changes live via preferredInteractiveOutput() comparison, so colors update immediately when switching monitors without requiring a workspace event. For the taskbar widget, applies the same logic to workspace disc labels. The doUpdate() loop detects focus changes and triggers a rebuild so disc colors update live across monitors. Config example: [widget.workspaces] focused_only = true [widget.taskbar] focused_only = true Visible in the settings GUI for both widgets.
6b1d154 to
6f93068
Compare
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.
Summary
New config option
focused_only = false(default) for the workspaces widget and taskbar widget. When enabled, only the monitor with keyboard or pointer focus shows the active workspace highlight color. Other monitors show their active workspace as occupied color instead.Motivation
In multi-monitor setups, every monitor simultaneously highlights its own active workspace, making it ambiguous which monitor actually has focus. This opt-in setting makes the focused monitor visually distinct from peripheral monitors.
Type of Change
Related Issue
N/A
Testing
ninja -C buildclean buildpython3 tools/i18n-check.pypassesclang-format --dry-run --WerrorpassesManual Coverage
Screenshots / Videos
N/A.
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes
Config example:
Implementation:
workspaceFillColor()checksisFocusedOutput()whenfocused_onlyis enabled. ThedoUpdate()loop in both widgets tracksm_wasFocusedOutputand triggers a retarget/rebuild when focus changes, so colors update immediately when switching monitors. The taskbar setting is visible in the settings GUI when "Show Workspace Label" is enabled.