Skip to content

Set scrolling layout direction to down on portrait aspect ratios - #1

Draft
neuensjohn wants to merge 4 commits into
quattrofrom
scrolling-direction-portrait
Draft

Set scrolling layout direction to down on portrait aspect ratios#1
neuensjohn wants to merge 4 commits into
quattrofrom
scrolling-direction-portrait

Conversation

@neuensjohn

Copy link
Copy Markdown
Owner

Scrolling sideways on a tall monitor wastes the height it was chosen for. A workspace on a portrait monitor now scrolls down instead of right when toggled into the scrolling layout.

The toggle reads the active monitor's logical size from hyprctl monitors, accounting for a rotating transform (and treating a missing one as unrotated), then records the direction in the saved workspace rule. A monitor that cannot be matched falls back to scrolling right rather than writing an empty direction into the persisted layout.

Commits

  • Query the active workspace once — the id and tiled layout each ran their own hyprctl call. Holding the response renames the variables so ACTIVE_WORKSPACE names the JSON and ACTIVE_WORKSPACE_ID the id, matching the sibling toggles.
  • Honor XDG_STATE_HOME — the toggle wrote to a hardcoded ~/.local/state while the loader resolved the directory through paths.state_home.
  • Let the workspace layout Lua load test faillua reports success for an uncaught error in a chunk read from stdin, so that test's assertions could not fail the suite. Naming stdin as a file and checking the status makes it real.
  • Set scrolling layout direction to down on portrait aspect ratios — the change above.

Testing

./test/all — 179 of 180 test files pass.

test/shell.d/runtime-smoke-test.sh fails identically on an untouched quattro (each widget registers its IPC handler once per screen (saw 3 for 2 screen(s))). It exercises shell/ QML IPC handlers; this branch touches only bin/ and test/shell.d/. Pre-existing and unrelated.

test/shell.d/hyprland-workspace-layout-test.sh covers landscape, native portrait, rotated portrait, rotated landscape, flipped and half-turn transforms, a missing transform, square, unknown monitor, and the toggle back to dwindle. Every commit passes its own tests, so the history stays bisectable.

Verified by mutation testing: inverting the portrait direction, ignoring transform, dropping the unknown-monitor fallback, writing the wrong workspace id, skipping persistence, and swapping the layouts are each caught by the suite.

neuensjohn and others added 4 commits August 23, 2026 15:44
The id and tiled layout each ran their own hyprctl call. Holding the
response means ACTIVE_WORKSPACE now names the JSON rather than the id,
so the id it is parsed from becomes ACTIVE_WORKSPACE_ID.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The toggle wrote to a hardcoded ~/.local/state while the loader in
default/hypr/workspace-layouts.lua resolves the directory through
paths.state_home, so a custom XDG_STATE_HOME sent the two apart. The
test hit exactly that, enumerating the developer's own state directory
while resolving modules against its temporary HOME.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lua reports success for an uncaught error in a chunk it reads from
stdin, so the assertions could not fail the suite. Name stdin as a file
and check the status.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Scrolling sideways on a tall monitor wastes the height it was chosen
for, so a portrait workspace scrolls down instead. The toggle reads the
active monitor's logical size, accounting for a rotating transform and
defaulting a missing one to unrotated, and the workspace rule records the
direction explicitly. An unmatched monitor falls back to scrolling right
rather than writing an empty direction into the saved layout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@neuensjohn
neuensjohn force-pushed the scrolling-direction-portrait branch from dddd13d to b364d25 Compare August 23, 2026 19:48
@neuensjohn
neuensjohn changed the base branch from quattro to tmp-base-refresh August 23, 2026 19:49
@neuensjohn
neuensjohn changed the base branch from tmp-base-refresh to quattro August 23, 2026 19:50
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