Skip to content

Swipe between workspaces with three fingers on Macs by default - #629

Merged
maralcbr merged 2 commits into
quattro-upstreamfrom
mac/apple-workspace-gesture
Sep 27, 2026
Merged

maralcbr merged 2 commits into
quattro-upstreamfrom
mac/apple-workspace-gesture

Conversation

@maralcbr

@maralcbr maralcbr commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

Owner decision 2026-09-27: turn on the three-finger horizontal workspace swipe by default on Apple Silicon. x86 and Snapdragon are unchanged.

  • default/hypr/apple-gestures.lua adds hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) on Apple Silicon. toggles.lua loads it, which is the one default module that runs after the user's files.
  • Hyprland 0.56 won't accept a gesture that an earlier one already covers, and reports the second one as a config error. On a Mac, helpers.lua records every hl.gesture call, so the default is skipped when the user already has a three-finger sideways gesture with no modifier (left, right, horizontal or swipe; mods = "NONE" counts as no modifier, as Hyprland reads it). Uncommenting the example in input.lua therefore leaves one gesture and no error.
  • To turn it off, set omarchy_workspace_gesture = false in ~/.config/hypr/input.lua. The Mac manual's trackpad section says how.
  • User config isn't touched, and there's no migration: installed hyprland.lua files already require default.hypr.toggles, so existing installs pick this up with the package.
  • Trade-off: on a Mac, a user's own hl.gesture error now points at the wrapper in helpers.lua and not at the user's file. Gestures added at the very end of hyprland.lua, after the toggles line, also load too late to replace the default. That's why the manual points at input.lua.

This stays in omarchy-mac. It's Apple-only, and upstream omacom#13362 carries no Mac code.

Tests: new test/shell.d/hyprland-apple-workspace-gesture-test.sh loads the shipped hyprland.lua against a stub that enforces Hyprland's overshadow rule. It covers Mac vs other platforms, the uncommented example, the focus examples, swipe, 4-finger, vertical, modifier and NONE cases, and the opt-out flag. It fails without the change. The related hyprland/touchpad suites pass on macOS and on the M2 (Arch).

Hardware (M2 Max converged, M1 Pro, Hyprland 0.56.2): after reload hyprctl configerrors is empty, and a probe hyprctl eval of the same gesture is refused as "overshadowed by a previous HORIZONTAL", so the gesture is live. On the M2, with the example uncommented there was no config error and still exactly one gesture. With the opt-out flag the gesture was gone. The user's file was restored afterwards.

Design debate: late registration was kept. Modifier normalisation and Mac-only wrapping were adopted from it.

Second review: it found one real regression. toggle-input-device-test loads the toggles without the helpers, so apple-gestures.lua now returns when o is missing. It also raised two test style nits, both fixed. It confirmed the rest against the Hyprland 0.56.2 source: the direction aliases, mods parsing, the fresh Lua state on reload, and that existing installs need no migration.

The default is added after the user's Hyprland files, and steps aside when
the user already set a three-finger sideways gesture, so uncommenting the
input.lua example does not trip Hyprland's duplicate-gesture error.
omarchy_workspace_gesture = false turns it off. x86 and Snapdragon keep no
default gesture.
Tests that load the toggles on their own have no o table.
@maralcbr
maralcbr merged commit 611091e into quattro-upstream Sep 27, 2026
6 checks passed
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