artginzburg / MiddleClick-Sonoma

 "Wheel click" with three-finger click/tap for Trackpad and Magic Mouse.
GNU General Public License v3.0
1.47k stars 85 forks source link

Closes #75: Fix multiuser double-middle-click #87

Open alex-f-k opened 7 months ago

alex-f-k commented 7 months ago

Fix #75: Subscribe to SessionDidResignActiveNotification and SessionDidBecomeActive to kill and resurrect touch callbacks

⚠️ This is my first try at Obj-C, beware ⚠️

Steps to reproduce

Hopefully with this fix it won't do that anymore :)

To be aware

default 14:06:34.762468+0000    MiddleClick HIDAnalytics Set Value Send event com.apple.iokituser.hid.iohidpostevent
default 14:06:34.762535+0000    MiddleClick HIDAnalytics Unregister Send event com.apple.iokituser.hid.iohidpostevent
default 14:07:07.024424+0000    MiddleClick Display reconfigured, restarting...
default 14:07:07.024468+0000    MiddleClick Display reconfigured, restarting...
default 14:07:07.157756+0000    MiddleClick User logged out, stopping...
default 14:07:07.157826+0000    MiddleClick Stopping unstable listeners...
default 14:07:09.025388+0000    MiddleClick User is logged out, abort restart...
default 14:07:09.204876+0000    MiddleClick Restarting app functionality...
default 14:07:09.204957+0000    MiddleClick Stopping unstable listeners...
default 14:07:09.206677+0000    MiddleClick Starting unstable listeners...
default 14:07:20.765225+0000    MiddleClick Display reconfigured, restarting...
default 14:07:20.765295+0000    MiddleClick Display reconfigured, restarting...
default 14:07:20.922754+0000    MiddleClick Display reconfigured, restarting...
default 14:07:20.922790+0000    MiddleClick Display reconfigured, restarting...
default 14:07:21.062414+0000    MiddleClick User logged back in, restarting...
default 14:07:21.062483+0000    MiddleClick Starting unstable listeners...
default 14:07:22.766397+0000    MiddleClick User is logged out, abort restart...
default 14:07:22.923851+0000    MiddleClick Restarting app functionality...
default 14:07:22.924016+0000    MiddleClick Stopping unstable listeners...
default 14:07:22.955471+0000    MiddleClick Starting unstable listeners...

I was testing, second user was logging in (initiated the switch with the fingerprint scanner) and it just didn't log in the second profile. Only showed lock screen with the spinning symbol (not beachball) instead of password field

Additionally I tried clicking on the first user again and typed the password - same thing, just a spinner and no progress

Maybe it is caused by some race condition from the previous log and I happened to switch too fast between them, but I really have no idea