mechtifs / wiggle

Gnome extension that magnifies the cursor when the mouse is moved rapidly.
GNU General Public License v2.0
24 stars 1 forks source link

Enalrgment duration #9

Closed Lija321 closed 5 months ago

Lija321 commented 5 months ago

the implementation seems to be broken in my testing, which makes the mouse unusable. also, the prefs page is no longer working due to a missing comma. sorry to revert your changes. if you can fix the above issues, welcome to open another pr :) (or i'd re-implement it someday?)

Originally posted by @mechtifs in https://github.com/mechtifs/wiggle/issues/5#issuecomment-2053618034

Lija321 commented 5 months ago

I fixed the prefs issue but can you describe what makes the mouse unusable. Im running on gnome 45 everything seems to be working

mechtifs commented 5 months ago

let me explain what went wrong: because an additional delay is now set manually, the variable isWiggling will also be updated after the delay. since unmagnify() is now asynchronous, it will be called multiple times during the delay until isWiggling is set to false if the delay is longer than 2x check timeout. what breaks the whole thing is the remove_child() function. when the child is already removed, it will panic. perhaps the old remove_actor() will just ignore it, or you're just using a delay value that is lower than 2x check timeout. but overall that definitely is problematic.

also i'd like to mention that the delay will not be an exact value. in order to achieve better performance, wiggle checks every 200ms by default. therefore, the actual delay will sit around [delay, delay+200ms]. to achieve better accuracy, the check timeout should be set to a lower value.

anyway, thanks for your suggestion :)