Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Why do I have to reactivate my app for this to work? #111

Open
travisgriggs opened this issue Mar 10, 2021 · 1 comment
Open

Why do I have to reactivate my app for this to work? #111

travisgriggs opened this issue Mar 10, 2021 · 1 comment

Comments

@travisgriggs
Copy link

I have a triple/triple click easter egg I use to toggle this on/off. It's great for making instructional videos. I find that the first time it gets turned on, it won't take until I switch away and back to my app to start seeing this visualization. After that initial swap, it toggles on and off just fine. It's just the first activation that doesn't take without an additional application reactivation.

@travisgriggs
Copy link
Author

It appears that the the only time that Window.swizzle() is called is on an activation event. So the "how to use this" makes a BIG assumption that you will call start before your application activates the first time. Since the swizzle method is guarded against repeat invocations, I simple added the same code to start() and then it works. Once swizzled, I guess your app stays swizzled forever, even if you turn it back off, you'll still be invoking the overhead of handleEvent: even if it is early out'ing each time. It would seem better to swizzle startup and unswizzle on stop. Is there a reason to avoid that type of implementation?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant