Skip to content

overview: click empty workspace cell to switch + close overview#189

Open
kanikamaxxing wants to merge 2 commits into
Axenide:mainfrom
kanikamaxxing:feat/overview-click-empty-cell-switches-workspace
Open

overview: click empty workspace cell to switch + close overview#189
kanikamaxxing wants to merge 2 commits into
Axenide:mainfrom
kanikamaxxing:feat/overview-click-empty-cell-switches-workspace

Conversation

@kanikamaxxing
Copy link
Copy Markdown

Summary

Single-click on an empty workspace cell in the overview now switches to that workspace and closes the overview. Previously a single click would only switch the workspace and leave the overview open, so opening a new window on an empty workspace required clicking the cell, then closing the overview, then spawning the window — two extra steps.

Also fixes a small stale-state issue where draggingTargetWorkspace wasn't always reset to -1 after a prior drag, which let the existing === -1 guard block subsequent legitimate clicks until the next drag.

Changes

  • Overview.qml cell MouseArea.onClicked: close the overview via Visibilities.setActiveModule(""), reset draggingTargetWorkspace defensively, then dispatch the workspace switch.
  • Uses hyprctl dispatch workspace <n> directly via a child Process so the click-to-switch path doesn't depend on AxctlService.dispatch succeeding for empty workspaces (some edge cases there).
  • Drops the previous onDoubleClicked handler since single-click now does what double-click did.

Test plan

  • Open overview, click empty cell — workspace switches and overview closes; can immediately spawn a window on the new workspace.
  • Drag a window across cells, then click an unrelated empty cell — click still fires (no more "stale dragTarget blocks click" symptom).

— robin

The mapped monitor object in AxctlService discards mon.metadata.x/y/transform
so monitorData.x is undefined for every monitor. OverviewWindow's position math
falls back to 0, which works for the monitor at the origin but renders windows
on any other monitor outside the thumbnail bounds (the global window x is used
without the monitor offset subtracted).

Also drops the per-monitor window filter in Overview so each overview shows all
windows across monitors, and computes per-window scale from the window's own
monitor width so cross-monitor windows fit the cell properly instead of being
sized for the overview's monitor.

OverviewWindow now also pins the target workspace to the drop monitor after
movetoworkspacesilent, so drops on cells in monitor A's overview actually land
on monitor A regardless of where the workspace currently lives. And imports
qs.modules.bar.workspaces so the existing CompositorData reference on drag
finalize stops throwing ReferenceError.

Repro for the primary bug: dual-monitor setup with monitors at non-zero offsets.
The overview on the second monitor renders all window thumbnails outside their
cell because monitorData.x is undefined and global x positions are used as-is.
Single-click on an empty workspace cell in the overview now switches to that
workspace and closes the overview, so the user can immediately interact with
or open new windows on the empty workspace. Previously single-click would only
switch the workspace and leave the overview open (a double-click was needed to
close it), which made the empty-cell flow feel like an extra step.

Also fixes a stale-state issue where draggingTargetWorkspace was not always
reset to -1 after a prior drag, blocking subsequent legitimate clicks via the
existing guard. The new handler resets draggingTargetWorkspace defensively and
uses hyprctl directly to avoid the same axctl edge cases that prevented the
workspace switch from firing.
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