Skip to content

fix(overview): decouple navigation from Hyprland dispatch#83

Open
enhulsman wants to merge 2 commits intoAxenide:mainfrom
enhulsman:fix/overview-decouple-dispatch
Open

fix(overview): decouple navigation from Hyprland dispatch#83
enhulsman wants to merge 2 commits intoAxenide:mainfrom
enhulsman:fix/overview-decouple-dispatch

Conversation

@enhulsman
Copy link

Problem

I noticed some odd behavior in the overview while using it on my dual-monitor setup. Pressing Tab to browse workspaces would close the overview entirely, because it dispatches workspace r+1 to Hyprland and the IPC event triggers HyprlandFocusGrab.onCleared. Moving my mouse over windows would jump the cursor around since focuswindow is dispatched on hover. With an empty search field, pressing Enter did nothing when I expected it to close the overview and go to whatever workspace I was looking at. And clicking a window would occasionally close the overview before the transition finished because the focus dispatch happens immediately.

These all turned out to be the same underlying problem: the overview dispatches Hyprland commands while the focus grab is active, and the resulting IPC events feed back and close it.

Solution

Decouple the overview from Hyprland dispatch by introducing local workspace tracking:

  • `trackedWorkspaceId`: local property that tracks which workspace the user is navigating to, without telling Hyprland
  • Workspace switches only dispatch after the overview closes and the focus grab is deactivated
  • Navigation intent bubbles up through `OverviewWindow → Overview → ScrollingOverview → OverviewPopup` without side effects
  • After navigating to a same-monitor window, the cursor is restored to the click position
  • Removed `focuswindow` dispatch on hover so the cursor no longer warps
  • Added `"workspace"` to the HyprlandData IPC ignore list to prevent spurious UI updates during navigation
  • Enter with an empty search now closes the overview, which just felt like the obvious expected behavior

Worth noting: when the search field has text but zero matching windows, `navigateToSelectedWindow()` still returns early (no match to navigate to). I left this as-is since Enter with a non-matching query being a no-op feels less surprising than closing the overview and losing the user's typed query.

Files Changed

  • `modules/bar/workspaces/HyprlandData.qml`: add "workspace" to IPC ignore list
  • `modules/widgets/overview/OverviewPopup.qml`: trackedWorkspaceId tracking, close-then-dispatch onAccepted
  • `modules/widgets/overview/OverviewView.qml`: pass trackedWorkspaceId down
  • `modules/widgets/overview/Overview.qml`: local workspace tracking, signal chain, cursor restoration
  • `modules/widgets/overview/OverviewWindow.qml`: signal-based navigation, remove hover dispatch
  • `modules/widgets/overview/ScrollingOverview.qml`: trackedWorkspaceId passthrough
  • `modules/widgets/overview/ScrollingWorkspace.qml`: signal-based navigation

Testing

  1. Open overview, press Tab: workspace indicator moves locally, overview stays open
  2. Open overview, press Enter (no text): overview closes, switches to tracked workspace
  3. Open overview, hover over windows: no cursor warping, no focus change
  4. Open overview, click window: overview closes, then focuses window
  5. Open overview, double-click window: navigates to window, cursor position preserved
  6. All above on multi-monitor

Introduce local workspace tracking (trackedWorkspaceId) so Tab/arrow
key navigation, window clicks, and Enter-with-empty-search no longer
dispatch Hyprland IPC commands while the focus grab is active. This
prevents the overview from closing itself mid-interaction due to
IPC-triggered onCleared events.

Changes:
- Tab/Shift-Tab/Arrow keys update trackedWorkspaceId locally
- Enter with empty search closes overview, then dispatches workspace
- Single-click on window emits workspaceNavigated signal (no dispatch)
- Double-click on window closes overview first, then focuses
- Remove focuswindow dispatch on hover (prevents cursor warping)
- Add "workspace" to HyprlandData IPC ignore list
- Dynamic badge sizing (12% of min dimension, floor 12px)
- Workspace tile background color prevents white bleed-through
- focusedWorkspaceIndicator z:10 for correct render order
Animate border.color instead of border.width on hover.
The width 0→2 animation caused geometry changes that
produced a brief visual glitch on the screencopy preview.
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