rxhanson / Multitouch-Community

Issue and feature request tracking for the Multitouch app
https://multitouch.app
38 stars 0 forks source link

"Snap window under cursor" not working #76

Open vincchan opened 4 years ago

vincchan commented 4 years ago

macOS BigSur Multitouch v1.19.5 (111)

Steps to reproduce

  1. Open any app and let it be not the frontmost window
  2. "Finder" should be the frontmost app
  3. When hovering over the former, not frontmost window and invoking gesture to close it
  4. doesnt work.
rxhanson commented 4 years ago

Thanks for reporting.

I'm not able to reproduce this one. I tried both snapping windows (left/right half) and the "Close window under cursor" action. These worked fine for me.

I'm assuming that your gestures are getting picked up by Multitouch otherwise, as in, it works fine when the window you want to snap is frontmost.

If you want some visual guarantee of gestures being picked up by Multitouch, you can view gesture match logging by opening the status bar menu, holding the option key, and selecting Debug | View Logging.

Perhaps I can reproduce it with some more specific details, like exactly which gestures and actions don't result in the desired result (a quick video works, too).

vincchan commented 4 years ago

Hello Ryan,

Thanks for the swift reply. Yes the multitouch gestures are being picked up, but they are acted upon the wrong window. As per the definition of "Snap window under cursor". It says, it enables all actions in the window management category to operate on the window under the cursor.

While "Close window under cursor" is on of the aforementioned category I expected it to work.

Here is the recording. With the debug window side-by-side

2020-11-13 16 56 13

  1. I showed to open Tweetbot.app using three finger tap
  2. Then I closed the Tweetbot window using the gesture that is picked up
  3. Reopen it but have Tweetbot not in Focus (Focus is now on Finder)
  4. Attempt to close it by hovering over the Tweetbot app and invoke the gesture.

As you see the the window will not close, a beeping sound is heared tho, while cmd+W is acted upon Finder.

I expected to have Tweetbot get focus and then applying the close action on tweetbot.

This behaviour works when hovering over Chrome to close it, but incidentally doesnt quite act as I would think. As I have another gesture that is "Close Tabs" on "Apps with tabs". In this case I expected Multitouch to grab Chrome's focus and close only 1 tab, but It closes the whole window.

2020-11-13 16 26 15

rxhanson commented 4 years ago

Sorry that it took me a bit to reply again on this one.

Are you zoomed in on macOS when this happens?

The close window under cursor action is not performing a cmd+w, but rather is using the Accessibility API to simulate clicking on the red x window button. My guess as to what is happening is that when you are zoomed in, the app is unable to correctly determine the cursor position so it doesn't actually grab the window under the cursor. You'll hear the beep because it probably just doesn't have a window when it tries to close.

vincchan commented 4 years ago

I think I narrowed this bug down to having Finder as the active app (the focused app). If I have Tweetbot.app active and invoke the gesture on a unfocused chrome window, it works fine.

I think the second issue comes up because I have two actions mapped to the same gesture.

Screenshot 2020-11-15 at 21 48 08

In which case the "Close window under cursor" always takes priority. Even tho its an app with Tabs.

rxhanson commented 4 years ago

Ok, this makes a lot more sense. Thanks for keeping at it and reporting back.

There are some limitations in place that prevent the behavior that you're expecting, and at the very least, the UI should have some restraint in place to prevent the resulting confusion here. It would be better if the app were capable of performing the behavior that you're expecting, but there's possibility that it would also introduce some user-noticeable lag to actions being executed.

I'll see if I can either fix up this behavior, and if it is not good then I'll patch up the UI to disallow duplicate gestures like this.