feat(wlr/taskbar): expose active toplevel state on the bar window#5126
Open
iamcheyan wants to merge 1 commit into
Open
feat(wlr/taskbar): expose active toplevel state on the bar window#5126iamcheyan wants to merge 1 commit into
iamcheyan wants to merge 1 commit into
Conversation
Add opt-in bar-css-states option to wlr/taskbar module. When enabled, the module tracks the active workspace and updates CSS classes on window#waybar to reflect the current window state: - toplevel-active: when a window is focused - toplevel-maximized: when any non-minimized window on active workspace is maximized - toplevel-minimized: when the active window is minimized - toplevel-fullscreen: when any non-minimized window on active workspace is fullscreen This feature requires compositor support for ext-workspace-v1 protocol to correctly track workspace membership. Without it, classes fall back to the active application state only. Also includes active-only option implementation. Changes: - Add ext-workspace-v1 protocol support for workspace tracking - Implement WorkspaceState tracking in Taskbar class - Add workspace management lifecycle (create/remove/done) - Add bar CSS class update logic with aggregation - Add visible() getter to Task class - Implement active-only task visibility control - Update man page with documentation and CSS examples Signed-off-by: iamcheyan <iamcheyan@users.noreply.github.com>
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.
Description
Add an opt-in
bar-css-statesoption to thewlr/taskbarmodule that exposes window state as CSS classes on the Waybar window (window#waybar).When enabled, the module tracks the active workspace and updates these CSS classes:
toplevel-active: when a window is focusedtoplevel-maximized: when any non-minimized window on the active workspace is maximizedtoplevel-minimized: when the active window is minimizedtoplevel-fullscreen: when any non-minimized window on the active workspace is fullscreenMotivation
Compositor-specific window modules like
sway/windowandhyprland/windowcan add state classes towindow#waybar, but generic wlroots compositors such as labwc lack an equivalent. This prevents users from styling the whole bar based on the active window state (e.g., making the bar fully opaque when a window is maximized).This feature bridges that gap for all wlroots compositors using the standard
wlr-foreign-toplevel-managementprotocol.Design
toplevel-prefix avoids collisions with classes managed by existing compositor-specific modulestoplevel-activeandtoplevel-minimizeddescribe the active tasktoplevel-maximizedandtoplevel-fullscreenare aggregated across all non-minimized tasks on the active workspaceext-workspace-v1protocolext-workspace-v1is unavailablefalsefor backward compatibilityChanges
ext-workspace-v1protocol support for workspace trackingWorkspaceStatetracking inTaskbarclassvisible()getter toTaskclassactive-onlytask visibility control (included in this PR)Configuration
Testing
Environment:
Verification:
meson setup -Dman-pages=enabled -Dcpp_std=c++20 buildtoplevel-activetoplevel-maximizedtoplevel-maximizedtoplevel-maximizedNotes
This PR includes the
active-onlyfeature from PR #5125 as both features modify similar code paths. If preferred, I can separate them.Signed-off-by: iamcheyan iamcheyan@users.noreply.github.com