Stolen mouse/keyboard events when using focus-follows-mouse + hotkey window + desktop switching
Environment
Running iTerm3 beta (build 2.9.20160206). This problem was not present in the 20150830 build (seems to be introduced in the next released beta build, from my testing).
I can reproduce this on Yosemite and El Capitan.
Summary
I've been experiencing issues where, occasionally, I'd see key and mouse events stolen by iTerm. I'd have to click between other iTerm windows before being able to switch to another application, or would have to Cmd-Tab. I couldn't click my way out.
I've traced this to a combination of Focus Follows Mouse, a configured (and open but hidden) hotkey window, and switching desktops.
Here's my repro case:
- Set up two virtual desktops. On the first, have an iTerm window and a web browser (or some other app) open. Position the browser so it's overlapping with the hotkey window. On the second, just have a web browser (or some app) but no iTerm window.
- Enable the hotkey window. In my case, it's docked at the top with a hotkey of Shift-Command->, but I've tested with other combinations (Shift-Option-`). Open this window at least once, so it's there, but keep it closed for the test.
- Focus the iTerm on desktop 1, stacked above the browser.
- Switch to desktop 2 (I tested with trackpad gestures and with a keyboard shortcut). The browser there should be focused.
- Now switch back. The focused application should be iTerm.
- Try to click the browser window in an area where the hotkey window (if open) would overlap.
You'll find that you can't switch to the browser, and that the focused app is still iTerm. To get out of this state, open and close the hotkey window.
This may take a few tries (my debug log shows it happening after maybe 2 or 3 attempts), but in my case, it's pretty consistent. I've had another person try to reproduce this and is seeing similar behavior (and noted that the hotkey window, in his case on Yosemite, appears as a sort of invisible window with an icon and Expose hover effect in Expose mode after reproducing, something I haven't seen here on El Capitan.)