rxhanson / Multitouch-Community

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

Multitouch failed to detect Magic Mouse on startup after macOS Sequoia Update #218

Closed sensires closed 2 months ago

sensires commented 2 months ago

I have Multitouch set to Start on login.

On update to macOS Sequoia, Multitouch will fail to detect my Magic Mouse, displaying the "No Magic Mouse Detected" notification in the button right corner of the Magic Mouse config pane.

I have to quit Multitouch post-start up, manually start it again, then it will detect my Magic Mouse and allow all configured gestures to work.

rxhanson commented 2 months ago

Sometimes a macOS update can take an extra reboot to get these APIs running smoothly.

If you've already done an extra reboot and you still have an issue, then you can reset the accessibility permissions for Multitouch and that might fix it, too.

  1. Quit Multitouch
  2. In System Settings -> Privacy & Security -> Accessibility, first disable Multitouch, then remove it with the minus button. (it's important to do both of those steps in that order).
  3. Launch Rectangle Pro and enable settings for it as prompted.

You could use the Terminal to execute tccutil reset All com.brassmonkery.Multitouch instead of step 2.

Let me know if you still have the issue; it might be timing.

sensires commented 2 months ago

So I have reboot more than a dozen times, and followed your 3 steps to no avail.

I do believe it to be a timing issue - my two AppleScript applications that reset my display profile / brightness and audio output device selection, set to run as Login Items, both started variably prompting errors "ScriptMonitor.app can't be opened" "The action 'run applescript' encountered an error: 'image events got an error: application isn’t running.'" after upgrading to Sequoia.

I tried resetting their privacy permissions, re-saving the applications and modifying my scripts to add conditions to ascertain the various processes were properly activated and running before performing any System Event accessibility actions. All didn't work. I had to add a crude 10 second delay right at the top of my script to allow macOS time to load and do all it needs - which I assume Apple changed rather substantially - before executing the rest of my scripts. Only then have my scripts worked again.

Let me know if the timing hypothesis is correct, if there is anything I can do or if the issue needs a Multitouch update to make the Magic Mouse detection (at macOS startup) more robust given the potentially changed macOS startup mechanics/timings? Thanks.

rxhanson commented 2 months ago

Thanks for the effort & detail. Would you mind testing this beta?

https://www.multitouch.app/downloads/multitouch1.27.38.dmg

sensires commented 2 months ago

Yup here are my observations - tl;dr didn't work:

After installation & reboot:

rxhanson commented 2 months ago

Bummer. Thanks, though! I'll post back when I have something else worth trying.

sensires commented 2 months ago

Ok hopefully this will be fixed soon.

For the moment I've resorted to turning off Start on login and launching Multitouch via a login items AppleScript app with a 10s delay.

rxhanson commented 2 months ago

If you don't mind, please try this one and let me know how it goes.

https://www.multitouch.app/downloads/multitouch1.27.39.dmg

In this version, you can configure a device listening delay (the default is 4 seconds).

defaults write com.brassmonkery.Multitouch deviceListenDelay -float 10

Of course, you can change that from 10 to a different number.

Let me know what you find.

sensires commented 2 months ago

Post v1.27.39 installation & reboot (without modifying the Multitouch default initially):

rxhanson commented 2 months ago

Great, thanks for the thorough testing! I think I have a clear enough picture now that I can put in a proper fix and you won't have to think about this one in the future.

As a side note, I don't see this at all on my end - it works properly without any changes. I'm curious what's different about your setup, but there's not really a good way to narrow down all of the things that could affect hardware detection.

sensires commented 2 months ago

Thanks! Looking forward to the more robust Magic Mouse detection for start on login.

rxhanson commented 2 months ago

Ok, so this latest release has improved the robustness of the device detection.

You can update within the app or from here: https://www.multitouch.app/downloads/multitouch1.27.40.dmg

It has a couple of adjustments, one of which will poll based off of the deviceListenDelay setting. So you could set that to a lower number and it would try 5 times, spaced on that delay.

Another adjustment should make that unnecessary, though, and it should just properly register without having to poll.

In the menu bar menu, you can select help -> debug -> launch log viewer on start, and this would show us if the proper adjustment works or if it ends up polling when you reboot. (You would have to go back in and click on that menu item again to turn off the log viewer launching on start again)

sensires commented 2 months ago

v1.27.40 - Ok so the detection with start on login worked as tested through 5 reboot-logins, but I am not sure if it is the 'other' adjustment you spoke of or the polling (which I reduced to 5s) that worked. Issue is resolved by my view, barring any other abnormal observations. Thanks!

For your reference:


Login 1 2024-09-23T15:25:11+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:25:11+08:00: Found device: 1452 834 51 2024-09-23T15:25:11+08:00: Registering device type internalTrackpad2 with location id 51. 2024-09-23T15:25:11+08:00: Registering device type internalTrackpad2 with device id 216172782113783859. 2024-09-23T15:25:12+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:25:17+08:00: Check for devices 5 2024-09-23T15:25:17+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:25:19+08:00: Found device: 76 617 1027097337 2024-09-23T15:25:19+08:00: Registering device type magicMouse2 with location id 1027097337. 2024-09-23T15:25:19+08:00: Registering device type magicMouse2 with device id 288230377178809081. 2024-09-23T15:25:20+08:00: Failed to initialize Magic Mouse from device id: 288230377178809081, attempts remaining: 4. 2024-09-23T15:25:21+08:00: Registered Magic Mouse with id: 288230377178809081


Login 2 2024-09-23T15:29:33+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:29:33+08:00: Found device: 1452 834 51 2024-09-23T15:29:33+08:00: Registering device type internalTrackpad2 with location id 51. 2024-09-23T15:29:33+08:00: Registering device type internalTrackpad2 with device id 216172782113783859. 2024-09-23T15:29:34+08:00: Found device: 76 617 1027097337 2024-09-23T15:29:34+08:00: Registering device type magicMouse2 with location id 1027097337. 2024-09-23T15:29:34+08:00: Registering device type magicMouse2 with device id 288230377178809081. 2024-09-23T15:29:35+08:00: Failed to initialize Magic Mouse from device id: 288230377178809081, attempts remaining: 4. 2024-09-23T15:29:36+08:00: Registered Magic Mouse with id: 288230377178809081


Login 3 2024-09-23T15:33:00+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:33:00+08:00: Found device: 1452 834 51 2024-09-23T15:33:00+08:00: Registering device type internalTrackpad2 with location id 51. 2024-09-23T15:33:00+08:00: Registering device type internalTrackpad2 with device id 216172782113783859. 2024-09-23T15:33:01+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:33:05+08:00: Found device: 76 617 1027097337 2024-09-23T15:33:05+08:00: Registering device type magicMouse2 with location id 1027097337. 2024-09-23T15:33:05+08:00: Registering device type magicMouse2 with device id 288230377178809081. 2024-09-23T15:33:05+08:00: Check for devices 5 2024-09-23T15:33:05+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:33:06+08:00: Failed to initialize Magic Mouse from device id: 288230377178809081, attempts remaining: 4. 2024-09-23T15:33:07+08:00: Registered Magic Mouse with id: 288230377178809081


Login 4 2024-09-23T15:37:16+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:37:17+08:00: Found device: 76 617 1027097337 2024-09-23T15:37:17+08:00: Registering device type magicMouse2 with location id 1027097337. 2024-09-23T15:37:17+08:00: Registering device type magicMouse2 with device id 288230377178809081. 2024-09-23T15:37:17+08:00: Found device: 1452 834 51 2024-09-23T15:37:17+08:00: Registering device type internalTrackpad2 with location id 51. 2024-09-23T15:37:17+08:00: Registering device type internalTrackpad2 with device id 216172782113783859. 2024-09-23T15:37:18+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:37:18+08:00: Failed to initialize Magic Mouse from device id: 288230377178809081, attempts remaining: 4. 2024-09-23T15:37:19+08:00: Registered Magic Mouse with id: 288230377178809081


Login 5 2024-09-23T15:38:42+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:38:42+08:00: Found device: 1452 834 51 2024-09-23T15:38:42+08:00: Registering device type internalTrackpad2 with location id 51. 2024-09-23T15:38:42+08:00: Registering device type internalTrackpad2 with device id 216172782113783859. 2024-09-23T15:38:43+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:38:47+08:00: Found device: 76 617 1027097337 2024-09-23T15:38:47+08:00: Registering device type magicMouse2 with location id 1027097337. 2024-09-23T15:38:47+08:00: Registering device type magicMouse2 with device id 288230377178809081. 2024-09-23T15:38:47+08:00: Check for devices 5 2024-09-23T15:38:47+08:00: Registering device type internalTrackpad2 with device id 144115188075855923. 2024-09-23T15:38:48+08:00: Failed to initialize Magic Mouse from device id: 288230377178809081, attempts remaining: 4. 2024-09-23T15:38:49+08:00: Registered Magic Mouse with id: 288230377178809081

rxhanson commented 2 months ago

Awesome, this is really helpful, thanks!

This is signaling that my adjustment has worked and there is no need for the polling mechanism although I will leave the polling in place as a failsafe. I have one small adjustment to make that should remove the failed initialization and single retry.

This also means that the Magic Mouse will be detected by Multitouch at the time that it is detected by macOS (rather than having any sort of delay by means of polling).

I suspect that your scripts did have a role in making Multitouch "miss" the detection of the Magic Mouse, but it exposed a fragile part of Multitouch that had potential to fail regardless.

Thanks again! Let me know if anything else comes up.