kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.37k stars 979 forks source link

Z-index/window stack order isssue on gnome + Arch #7445

Closed drschwabe closed 5 months ago

drschwabe commented 5 months ago

Kitty often loses its ability to be 'clicked' when its in the background where foreground windows are in front of it. There's weird behavior where the other windows in foreground will toggle focus even when clicking the kitty background.

The expected behavior is obviously when you click Kitty even if windows are in the foreground Kitty will appear above the stacking order.

The workaround when this happens is to Alt-Tab directly to Kitty and then it has focus as expected.
Or to close the Kitty window entirely and start a new one (until the issue occurs again)

To Reproduce Steps to reproduce the behavior:

  1. use kitty for a while with a bunch of other windows like browser, a text edtitor, etc
  2. eventually the aforementioned window bug starts happening

It doesn't always happen and seems to be more prone to happening when i have a long running process that is spitting out lots of lines at once to stdout.

It could also be a gnome bug but I only have this issue with Kitty so I decided to post the issue here first in my attempt to solve the issue.

kovidgoyal commented 5 months ago

There is no such thing as "ability to be clicked". kitty does not focus itself when it is clicked, that is done by the window manager, so if kitty is not getting focused on click the issue is in the window manager.

Since you are running under X11, what happens is the x server sends a client a "FocusIn" event to indicate to it it now has keyboard focus.

Note that you can see all keyboard and mouse events kitty receives from the system by running it with --debug-input.

drschwabe commented 5 months ago

Ok thanks perhaps i'll look into the bug via gnome then and/or try a different desktop manager to split test the issue.

The odd thing is that when this bug happens you can get kitty's focus back (ie- by alt tab) but it still cannot be clicked - it can only receive keyboard input - if you try clicking kitty the foreground windows unexpectedly appear where you click.

kovidgoyal commented 5 months ago

On Fri, May 17, 2024 at 08:25:59AM -0700, Derrick Schwabe wrote:

Ok thanks perhaps i'll look into the bug via gnome then and/or try a different desktop manager to split test the issue.

The odd thing is that when this bug happens you can get kitty's focus back (ie- by alt tab) but it still cannot be clicked - it can only receive keyboard input - if you try clicking kitty the foreground windows unexpectedly appear where you click.

This is again not something kitty can be doing. It cannot bring random other windows into focus. Only the window manager can do that.