Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
When reconnecting the kitty window (which is being hidden in the tray) will cause the active window to lose focus #238
Comments
|
We have the same annoying problem |
|
Did you try to change your bell setting in Terminal/Bell panel ? |
|
I just tried to change it from alert sound to none and then disconnecting and reconnecting the Internet connection. The result is the same: the kitty window which is hidden in the tray still steal focus when it is reconnecting. |
|
Can you test this build ? |
|
Yes the focus is still stolen with that build. If you want to test it yourself you could also use Process Hacker, close the kitty connection to port 22 in the Network tab in Process Hacker, and see the Process Hacker window losing focus after a while, while kitty is reconnecting. |
|
I did not reproduce. Can you send me a memory dump of the session that steal the focus ? |
|
I hooked the kitty process to winapioverride and found that these two functions are called when it steal focus https://github.com/cyd01/KiTTY/blob/master/0.74_My_PuTTY/windows/window.c#L3336
Maybe a check can be added there to skip calling those functions if the window is currently hidden in the tray. |
|
For what it's worth, I'm seeing the exact problem with 0.74.2.7, it's not just @char101. I came here to see if there was a solution :). I can't think of a single situation where it's appropriate to steal focus. |
|
I may have used the wrong term here. Flashing seems to meant that the taskbar icon is flashing, while what I meant was the kitty window appear and disappear for a very short time (although I guess it isn't what is happening here). The actual problem is that the currently foreground window (e.g. the editor I'm typing in) will suddenly lose focus. |
|
I thought to something else. |
|
That's exactly what @char101 has proposed. |
Unfortunately the focus is still lost with this build. Winapioverride still shows that |
|
Are you sure ? |
|
I have just tested it again (kitty-debug.exe, Last-Modified: Tue, 03 Nov 2020 22:10:29 GMT) and now it does not steal focus anymore. Thanks. |
|
Keep this debug build. |
|
I already downloaded the new release from the release page on github though, so no need to wait for fosshub. |

When reconnecting the kitty window which is being hidden in the tray area will activate for a very short term thus taking the focus from current active window.
Steps to reproduce
Verified using focus.exe from https://www.happydroid.com/focus to monitor the focused windows.