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

Initiating a scroll becomes laggy after the app has been running for a long time #77

Open 1000hz opened 11 months ago

1000hz commented 11 months ago

I've noticed that after the app has been running for a significant length of time (maybe a week or more?) there will start to be a significant lag when beginning a trackpad scroll gesture. It doesn't seem to be gradual; I'll just suddenly start noticing scrolling is severely lagging.

Scrolling won't start until about 700ms after the gesture, though once the scroll has started it remains smooth and responsive. Starting a new scroll gesture after the previous one has ended again suffers from a delayed start. Restarting MiddleClick restores performant scroll behavior.

I'm running MiddleClick 2.6.1 on macOS Ventura 13.4.1.

artginzburg commented 11 months ago

Thanks for taking the time to bring this up!

I'm experiencing the same issue. No clue why this happens yet. Maybe there's a memory leak, or maybe the old listeners are not always being removed, and they end up competing. Or it may have something to do with this: https://github.com/gm-vm/MiddleClick-Ventura/commit/0d509b73ba0dbbb682b3fa16f53e1bc5ddcbd596.

khesed commented 10 months ago

significant length of time (maybe a week or more?)

Consistent on Sonoma often within the day

Restarting MiddleClick restores performant scroll behavior

Would you consider adding an auto-restart to the app on user login?

Arecsu commented 7 months ago

Experiencing the same here as well. Happens after having the app open for a couple of days. Restarting the app fixes the issue. As described above, maybe a workaround is to auto-restart at user login. Don't know if that's possible though. A workaround nonetheless, but still better than nothing 😅

Cox5 commented 5 months ago

I have the same issue. Took me weeks to figure out it was related to this app. I hope the workaround isn't difficult to implement in a new version.

paulora2405 commented 5 months ago

I'm also experiencing the same issue, currently on Sonoma 14.2.1. Restarting the app fixes the issue.

Cox5 commented 5 months ago

I'm also experiencing the same issue, currently on Sonoma 14.2.1. Restarting the app fixes the issue.

I updated to the latest version of Middleclick and so far, after 2 days and lots of closing/opening the lid, scroll is still smooth. Maybe the issue has been fixed in the new version, we'll see

paulora2405 commented 5 months ago

I've managed to come up with a temporary solution to restart the app every few hours, here is how to do it:

In some directory in you home dir (mine was in ~/.local/scripts/middleclick_restart.sh) create a bash script, and put the following in it:

#!/bin/bash
killall MiddleClick
sleep 1
open -a MiddleClick

Make it executable with chmod +x middleclick_restart.sh.

Now create a LaunchAgent plist file in ~/Library/LaunchAgents/com.paulo.middleclick_restart.plist (replace paulo with your user), with the following inside:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <!-- REPLACE WITH YOUR USER -->
        <string>com.paulo.middleclick_restart</string>
        <key>ProgramArguments</key>
        <array>
            <!-- REPLACE WITH YOUR SCRIPT PATH -->
            <string>/Users/paulo/.local/scripts/middleclick_restart.sh</string>
        </array>
        <key>StartInterval</key>
        <integer>14400</integer>
    </dict>
</plist>

Note the absolute path to the script, do not use ~.

And now load it with launchctl by doing:

launchctl load -w ~/Library/LaunchAgents/com.paulo.middleclick_restart.plist

Now every 4 hours, the app will restart.

ejerskov commented 4 months ago

+1

arhipy97 commented 2 months ago

Are there any updates?

Chakubikulus commented 2 months ago

+1 Still does this at random intervals it seems, it lags the whole computer after a while

bhajneet commented 1 month ago

This issue currently has the most thumbs ups and is still open. @artginzburg I see above in the comments that the cause was unknown in 2023, and just wondering now if you've gotten any more insight in 2024?

I rely on this program and personally was able to "solve" the problem by using the method in @paulora2405 's comment, but this issue stops me from recommending the program to others who are not as technically savvy

alexchexes commented 4 hours ago

Bump. Please fix this so we don't buy overpriced proprietary solutions.

alexchexes commented 4 hours ago

And does anyone know if @paulora2405's solution works when working with multiple users? For example, I have two users and both are logged in. Should I create and run the scripts in both of them? Will it automatically restart the app inside a user that is currently switched-out (but still logged-in)?