Describe the bug
This will not be easy to describe ๐
Basically, I started to having issues with PhpStorm in that sometimes I would perform keyboard interaction and suddenly PhpStorm would not accept any keypress anymore.
I was already about to open a bug at https://youtrack.jetbrains.com/ _but_ during writing the report there I did more analysis and suddenly I found out I don't have this problem when I quit AltTab ๐ข
To me, it's 100% reproducible with "PhpStorm 2020.3 EAP Build #PS-203.4449.24, built on October 8, 2020" and AltTab 6.7.3 (I just updated it to verify)
What the gif below shows:


Basically it looks like something is "over shadowing" the PhpStorm window. Note that for this to occur, I did not even invoke the AltTab feature. It was just started/running without ever being invoked.
๐คทโโ๏ธ

PS: I'm happy to also report this on YouTrack, but after by pure gut feeling I found the relation to AltTab, I decided to open it here first, thanks
Ok, seems there's more to properly investigate here. I further found out:
I currently don't know any other way to trigger this, so so far it seems that the "branch rename" modal dialog from PhpStorm is somehow "special" here and interferes with AltTab in some way.
I could reproduce this on the latest IntelliJ IDEA EAP with no customizations whatsoever:
Thank you very much for this Sherlock Holmes investigation @mfn! I had a blast reading the intricate explanations ๐
I will try to reproduce locally and see what could be at play here. Based on the symptoms, I have no clue what it could be.
Quick question in the meanwhile: did this happen / does it happen with AltTab 6.7.2?
does it happen with AltTab 6.7.2?
Yes!
I was able to reproduce locally! At first I couldn't, on my IntelliJ, but then I installed the EAP, and there it reproduces. This seems to be exclusive to the EAP version then.
Also notable, the shortcuts are not working only when I stay focused on IntelliJ. As soon as I focus another app, and come back to IntelliJ, then they work again, without a need to quit AltTab.
I found the root cause!
It has nothing to do with keyboard events, contrary to what I assumed. It's the same exotic issue I witnessed in the past with another app called Protege. Somehow, just subscribing to the accessibility events of IntelliJ EAP breaks the scenario with branch renaming. Subscribing to accessibility events (using AXObserverCreate + AXObserverAddNotification) should never affect an app. It's supposed to be passive observation for accessibility app like a screenreader, or AltTab. However somehow it affects the app in this case, and in Protege's case.
It looks like a clear bug from macOS API here. Observing an app shouldn't break it. Also it's only happening for kAXFocusedUIElementChangedNotification, not the dozen other notification types.
I'll include a workaround in the next release ๐
Confirmed, does not break anymore (also in PhpStorm), thank you!
Most helpful comment
I found the root cause!
It has nothing to do with keyboard events, contrary to what I assumed. It's the same exotic issue I witnessed in the past with another app called Protege. Somehow, just subscribing to the accessibility events of IntelliJ EAP breaks the scenario with branch renaming. Subscribing to accessibility events (using
AXObserverCreate+AXObserverAddNotification) should never affect an app. It's supposed to be passive observation for accessibility app like a screenreader, or AltTab. However somehow it affects the app in this case, and in Protege's case.It looks like a clear bug from macOS API here. Observing an app shouldn't break it. Also it's only happening for
kAXFocusedUIElementChangedNotification, not the dozen other notification types.I'll include a workaround in the next release ๐