fix(hyprland): keep workspace hover over taskbar icons#5048
Open
Praczet wants to merge 1 commit into
Open
Conversation
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
Fixes hover styling for
hyprland/workspaceswhenworkspace-taskbar.enable = true.When the pointer moves from the workspace label/button area onto a taskbar window icon, GTK can stop matching
#workspaces button:hoverfor the parent workspace button. Visually, the pointer is still inside the workspace button, but CSS rules targeting the parent hover state are no longer applied.This patch adds a dedicated
workspace-hoverstyle class while the pointer is inside the workspace button area. This gives users a stable selector for styling the parent workspace button while hovering taskbar child widgets.Example CSS:
Why
workspace-taskbaradds child widgets for window icons inside the workspace button. GTK crossing events can make the parent button lose its normal:hoverstate when the pointer enters one of those child widgets.This is especially visible when users dim inactive workspace buttons or icons with opacity: the workspace appears to lose hover styling when moving from the workspace label to a window icon.
The added
workspace-hoverclass keeps the parent workspace styling available while the pointer remains inside the workspace button area.Implementation notes
The class is added on enter events.
On leave, the patch does not immediately remove the class, because leave events can also be emitted when moving into child taskbar widgets. Instead, it uses a small timeout-based check to verify whether the pointer has actually left the workspace button area before removing
workspace-hover.Tested
Tested locally with:
hyprland/workspacesworkspace-taskbar.enable = true#workspaces button:hoverand#workspaces button.workspace-hoverChecked behavior:
Related
Related / similar discussion: