TouchVisualizer
TouchVisualizer copied to clipboard
Why do I have to reactivate my app for this to work?
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.
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?