tst-wheel_and_double icon indicating copy to clipboard operation
tst-wheel_and_double copied to clipboard

Fix race condition.

Open account-login opened this issue 4 years ago • 1 comments

This fixes https://github.com/joshuacant/tst-wheel_and_double/issues/18

The cause of the problem is that the event handlers for mouse wheel events are running concurrently. For example, event1 finds out the active tab to be tab1, and then switches to tab2, before the switching to tab2, event2 also finds out the active tab to be tab1, and then switches to tab2, resulting in the 'skipping' behavior.

To fix the problem, the execution of the event handler should be serialized. And we can not rely on the TST event data to find out the active tab, since the TST event may be generated before tab switching is done.

account-login avatar Apr 16 '20 16:04 account-login

Sorry, I have had almost no free time to check this out. I'll examine it when I have a free moment and likely include it in a future build (but not release a build specifically for this).

You seem like you know what you're doing, at least more than I do. Do you have any thoughts about #22? I started with the sample code from Piroor and when that was failing a lot, I wrapped it in the registrationTimeout loop that tries multiple times (with increasing delays). That made things much better and the failed registrations on startup almost completely went away. The problem seems to come and go and I can't tell if that's due to changes in Firefox or in TST or something I've done wrong.

joshuacant avatar Apr 27 '20 00:04 joshuacant

Hey, any chance you could pull this and update the extension? Would make a big difference to usability...

e-daniel avatar Dec 11 '22 14:12 e-daniel

Gonna be honest: I completely forgot about this. I don't ever run into whatever problem this solves, I'm not even sure how to replicate it outside of artificially creating it via the AHK script posted in the issue.

I should have some free time coming up around the end of this month and start of the new year. I'll get a dev environment up and check out this PR. Enough people have brought it up now that it must be real. 😄

joshuacant avatar Dec 13 '22 18:12 joshuacant

Hi all, I have FINALLY (sorry!!!) uploaded a beta version to AMO with this change (and others). If you would like to try it out, visit this link: https://addons.mozilla.org/firefox/downloads/file/4181773/tree_style_tab_mouse_wheel-1.5.4.xpi

It's a fully signed extension by Mozilla, so you can install it in normal Firefox, but it's not pushed out via the main channel. So if you encounter any problems you can let me know and then downgrade to the published version 1.5 here: https://addons.mozilla.org/en-US/firefox/addon/tree-style-tab-mouse-wheel/

Feedback would be appreciated.

joshuacant avatar Oct 16 '23 21:10 joshuacant

I've been informed that at least some people are getting an error on that addons.mozilla.org link. I uploaded the test XPI here: https://github.com/joshuacant/tst-wheel_and_double/releases/tag/1.5.4

joshuacant avatar Oct 16 '23 21:10 joshuacant