Skip to content

fix(hyprland): keep workspace hover over taskbar icons#5048

Open
Praczet wants to merge 1 commit into
Alexays:masterfrom
Praczet:fix/hyprland-workspace-taskbar-hover
Open

fix(hyprland): keep workspace hover over taskbar icons#5048
Praczet wants to merge 1 commit into
Alexays:masterfrom
Praczet:fix/hyprland-workspace-taskbar-hover

Conversation

@Praczet
Copy link
Copy Markdown

@Praczet Praczet commented May 17, 2026

Summary

Fixes hover styling for hyprland/workspaces when workspace-taskbar.enable = true.

When the pointer moves from the workspace label/button area onto a taskbar window icon, GTK can stop matching #workspaces button:hover for 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-hover style 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:

#workspaces button:hover,
#workspaces button.workspace-hover {
  /* hover styling */
}

Why

workspace-taskbar adds child widgets for window icons inside the workspace button. GTK crossing events can make the parent button lose its normal :hover state 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-hover class 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:

  • Waybar built from this branch
  • Hyprland
  • hyprland/workspaces
  • workspace-taskbar.enable = true
  • CSS using both #workspaces button:hover and #workspaces button.workspace-hover

Checked behavior:

  • Hovering the workspace label applies hover styling
  • Moving from the workspace label to a taskbar window icon keeps hover styling
  • Moving between taskbar window icons keeps hover styling
  • Moving outside the workspace button removes hover styling

Related

Related / similar discussion:

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.

1 participant