Skip to content

✨ Trackpad gestures - #1064

Merged
mrkai77 merged 100 commits into
developfrom
subsurface-gestures
Sep 29, 2026
Merged

mrkai77 merged 100 commits into
developfrom
subsurface-gestures

Conversation

@mrkai77

@mrkai77 mrkai77 commented Mar 5, 2026 •

Copy link
Copy Markdown
Owner

Adds trackpad gestures!

With this PR, Loop will now include a new package dependency called Subsurface. This is a Swift package that provides a clean interface to the private MultitouchSupport framework. Here’s a small demo of trackpad gestures in action (although this is actually quite outdated, the current functionality is much more refined!). The plan is for it to trigger only when the cursor is over the title bar, similar to Swish:

gestures.mp4

@mrkai77 mrkai77 self-assigned this Mar 5, 2026
@mrkai77 mrkai77 changed the title ✨ Subsurface trackpad gestures ✨ Trackpad gestures Mar 5, 2026
@mrkai77 mrkai77 linked an issue Mar 5, 2026 that may be closed by this pull request
2 tasks done
@mrkai77 mrkai77 added the Feature label Mar 5, 2026
@SenpaiHunters
SenpaiHunters marked this pull request as draft March 5, 2026 04:45
@SenpaiHunters

Copy link
Copy Markdown
Collaborator

Remember to update the readme table, to now show that we support trackpad gestures! 🎉

@JaceThings

Copy link
Copy Markdown
Contributor

Goated

mrkai77 added 5 commits March 8, 2026 18:19
# Conflicts:
#	Loop.xcodeproj/project.pbxproj
# Conflicts:
#	Loop/Window Management/Window Manipulation/WindowFrameResolver.swift
@mrkai77
mrkai77 force-pushed the subsurface-gestures branch from 8396cd0 to 2768be8 Compare March 9, 2026 00:22
@AlejandroVolkova

Copy link
Copy Markdown

Wow, this is awesome! It’s exciting to see it coming together! I just had a couple of thoughts after watching the demo. In the video, I noticed that windows move and resize instantly with the gestures. Would it be possible to instead show the preview animation before the actual move? Especially for circle gestures, previewing the desired position before the actual window move would be helpful and could make the overall experience feel smoother (essentially the same behavior you get when using the trigger key or window snapping.)

I was also wondering if custom gestures might be supported. For example, being able to assign a gesture to maximize or minimize windows. Personally, I’d love to disable Mission Control and Exposé so I could use a four-finger drag up/down gesture for maximize/minimize instead.

And finally, will haptic feedback be part of this feature? It could add a really nice touch to the interaction.I know this is still under development, so please take these just as friendly suggestions in case they’re helpful 😅 Thanks for making this possible!

@mrkai77

mrkai77 commented Mar 11, 2026

Copy link
Copy Markdown
Owner Author

Thanks @AlejandroVolkova!

In the video, I noticed that windows move and resize instantly with the gestures. Would it be possible to instead show the preview animation before the actual move?

Definitely, this will stay consistent with Loop’s existing settings :)
I just happened to have “Show preview when looping” turned off in the demo, which is why the windows moved instantly instead of showing the preview first.

I was also wondering if custom gestures might be supported. For example, being able to assign a gesture to maximize or minimize windows. Personally, I’d love to disable Mission Control and Exposé so I could use a four-finger drag up/down gesture for maximize/minimize instead.

We’re definitely considering that as well. The rough idea I have right now is a dedicated Gestures tab in Settings, where you could assign a list of gestures to actions, similar to the Keybinds tab. For example, a two-finger slide (in any direction) to open the radial menu, a three-finger slide right to trigger a different action, or a four-finger swipe up to trigger another one.

I’m still very much in the brainstorming stage for how all of this would be configured, though, so that’s just the direction I’ve been thinking in so far. I’d love to hear any ideas you have on how that should work!

And finally, will haptic feedback be part of this feature?

Absolutely :)

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 I think the implementation is brilliant. Invoking the radial menu from the title bar is a great choice, since it avoids false triggers in the app’s content view, which is one of the challenges with custom trackpad gestures.

Maybe it would feel even more natural to use a two‑finger pinch‑in to invoke the radial menu. I can imagine that once the radial menu is invoked via a trackpad gesture, it could stay persistent so the user can decide the next action, for example, a one‑finger swipe left to move a window to half the screen, similar to how the trigger key works currently with directional input from the trackpad.

On iPadOS there’s a gesture to minimize all other app windows when using “Windowed Apps.” Perhaps something similar could be achieved here by invoking the radial menu and swiping down with Three‑finger to trigger “Minimize others.”

Some actions might work best without invoking the radial menu at all. For instance, maximize or minimize could be triggered frictionlessly, just like swiping between spaces. That’s why I think Four‑Swipe‑Up → Maximize | Four‑Swipe‑Down → Minimize would be ideal, since those gestures can be triggered anywhere without interfering with app content. It would also be nice to keep the preview animation when maximizing, to stay consistent with Loop’s aesthetic and refinement.

Overall, the idea of a dedicated Gestures tab in Settings already sounds like the right direction. Other possible actions when invoked with the radial menu could be:

• Hide → Pinch out (Spread With Thumb And 3 Fingers)
• Center app → Three‑finger swipe up
• Stash → Three‑finger swipe right

It’s also worth mentioning that three‑finger gestures can sometimes cause conflicts when using the option Accessibility → Pointer Control → Trackpad Options… → Dragging style → Three Finger Drag

Of course, all of these suggestions ultimately depend on how they feel in practice when testing the software :) They just came to mind from my past experiments with custom gestures, so thank you so much for being open to feedback. I really appreciate the chance to contribute ideas :) !

@343max

343max commented Mar 19, 2026

Copy link
Copy Markdown

I just came looking here because I was wondering if I should implement this feature. Please please please make it so that I can use four finger gestures to trigger the actions. I'd love to see the implementation exactly as it is right now, but instead of doing a Modifier-Drag gesture I could just do a multitouch-drag without a modifier.

mrkai77 added 2 commits April 5, 2026 00:03
# Conflicts:
#	Loop.xcodeproj/project.pbxproj
#	Loop/Settings Window/Settings/Keybinds/Modal Views/CustomActionConfigurationView.swift
#	Loop/Settings Window/Settings/Keybinds/Modal Views/StashActionConfigurationView.swift
#	Loop/Stashing/StashManager.swift
#	Loop/Window Management/Window Manipulation/ResizeContext.swift
#	Loop/Window Management/Window Manipulation/WindowActionEngine.swift
#	Loop/Window Management/Window Manipulation/WindowEngine.swift
#	Loop/Window Management/Window Manipulation/WindowFrameResolver.swift
#	Loop/Window Management/Window Manipulation/WindowRecords.swift
@mrkai77
mrkai77 force-pushed the subsurface-gestures branch from 357ca2b to 7267e37 Compare April 5, 2026 09:42
@mrkai77
mrkai77 force-pushed the subsurface-gestures branch from 7267e37 to 92cd898 Compare April 5, 2026 09:55
@mrkai77
mrkai77 force-pushed the subsurface-gestures branch from b0ecbda to 3014b17 Compare September 24, 2026 17:23
@github-actions

Copy link
Copy Markdown
Contributor

🚧 Development Build Finished

@mrkai77

mrkai77 commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Merging this so that it will be included in dev builds! Won't update the README just yet until the feature is included in a public release, though.

@mrkai77
mrkai77 merged commit 6790d46 into develop Sep 29, 2026
1 check passed
@mrkai77
mrkai77 deleted the subsurface-gestures branch September 29, 2026 02:25
@AlejandroVolkova

Copy link
Copy Markdown

Not sure if I fully understand this, I’m on a dev build that was published after this commit was merged. The option is already showing up in the menus, but it doesn’t seem to be functional yet.

Should it already be working in current dev builds, or is there still something else that needs to land before the feature becomes functional?

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova oh weird, it should already be working when enabled. I’m currently adding some more logging to make this easier to debug, but in the meantime, could you download and open this app? Visualizer.zip

It’s the little visualizer app shown in the video preview at the top of this PR. This should already help narrow down whether Loop is failing to receive your trackpad swipes at all, or if something inside Loop is going wrong after the gestures are detected. To start it, just open the app’s inspector panel and press the start button.

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 the visualizer app doesn’t show gestures, so it seems the trackpad inputs aren’t being recognized. To check further, I created a new user profile and also tested on macOS Sonoma, since I first thought it might be a compatibility issue with macOS 27. In all cases, though, gestures didn’t respond.

Here's a video:

Loop.Gestures.Test.mp4

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova perfect, seems like we’ve already isolated the issue! I’m going to add some more debug info to the visualizer to help figure out what might be going wrong.

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 Awesome, let me know if there's anything I can help with :)

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova could you try this? Made some improvements to trackpad device management: Visualizer.zip

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 I tested this, but it still doesn't register trackpad inputs on my side :(

Visualizer.Test.2.mp4

@mrkai77

mrkai77 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova if you select "Individual" under the tracking mode option, do any devices show up?

To check further, I created a new user profile and also tested on macOS Sonoma, since I first thought it might be a compatibility issue with macOS 27

And just to make sure I’m understanding this correctly, it’s not working on two devices? That’s quite unusual :/

@AlejandroVolkova

Copy link
Copy Markdown

This is what it shows up under individual:

Individual

And just to make sure I’m understanding this correctly, it’s not working on two devices? That’s quite unusual :/

it's the same MacBook Pro but different boot drives: macOS 27 on the internal NAND memory and macOS Sonoma on an external NVMe drive, fully different environments as well.

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova actually, seeing that you have a Touch Bar made me look into how the app handles Macs with Touch Bars, and I think I found the cause! Let me know if this build correctly recognizes your trackpad: Visualizer.zip

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 That's very odd because my MacBook doesn't have a Touch Bar. I'm running a 2021 model MacBook Pro M1 Max 16-inch, but the good news is this visualizer version does recognize my trackpad. Here's a demo :)

Visualizer.mp4

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova perfect! Looks like there may be quite a bit of Touch Bar mislabeling in the codebase then, so thanks for flagging that! I'll be releasing a new Loop dev build with these fixes later today. I'll let you know once it's out!

@mrkai77

mrkai77 commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@AlejandroVolkova a new development build with these fixes is out now! Please give it a try and let me know if everything works :)

@AlejandroVolkova

Copy link
Copy Markdown

@mrkai77 Awesome! It’s working perfectly now :D I really love how this turned out. I’m glad I can finally try it out and discover new gestures to play with 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Trackpad gestures to trigger Loop

6 participants