[wayland] maximized/fullscreen kitty window is changed back to floating when alt+tabbing
Kitty is a terminal emulator: https://github.com/kovidgoyal/kitty
I see the following bug on mutter 42.5 using Wayland:
- Open Kitty with a floating window (
kitty
), and close it. - Open Kitty in fullscreen mode or maximized mode and with disabled client side decorations (
kitty -o hide_window_decorations=y --start-as fullscreen
/kitty -o hide_window_decorations=y --start-as maximized
). What it will do is first start in floating mode (remembering the size from the previous instance) and then switch to fullscreen or maximized. - The displayed window will correctly resize but sometimes the new window dimensions are not correctly picked up by mutter. This can be for example by seen via the "Switch windows directly" shortcut (default: Alt+Escape), which draws nice borders around the windows. While the displayed window occupies the entire screen, the border shown by Alt+Escape is the size of the previous (floating) instance.
- Then, when invoking Alt+Escape a second time, also the displayed window is resized to the size of the previous instance again.
Here's a screencast: https://user-images.githubusercontent.com/1071625/197488167-6fa77b59-aac3-48cc-9e8f-2739bbfd15cf.webm
Some notes about the screecast:
- Extensions are turned off (as seen in the initial frame). Also I configured the "Switch windows directly" shortcut to Super+Tab
- I'm using gnome-terminal (green font) to invoke kitty (white font).
- I screw the up the order of events a few times, and also that the bug doesn't show up initially.
- If you look carefully, you'll notice I use a different method to tell kitty to disable window decorations than described above, but that of course doesn't matter.
- When you skip to 0:54, you can see a successful reproduction of the issue. The first few window switches are with Super hold for a few second, and I just press tab a few times. The kitty windows is displayed as fullscreen but the blue border is centered with the original window size.
- Then at around 1:05, I release Super and press it again to restart the GNOME's window switching thing. At this point, you see that mutter now actually resizes the kitty window to what it thinks is its size (but moves it to the top-left corner). It's a little bit hard to see because both the kitty window (white font) and the gnome-terminal window (green font) have a black background. This shows that the issue is not just that the wrong border is displayed, i.e., it is not just cosmetic.
I reported this to kitty (https://github.com/kovidgoyal/kitty/issues/4802#issuecomment-1288695662 -- note that my report there isn't related to the main topic of the issue) and the maintainer thinks it's a bug in mutter. He suggests to add --debug-rendering
and says:
From the debug rendering output you will see that the final size kitty sends to mutter is the full screen size. Why mutter doesnt respect that, I have no idea. Likely some timing issue in mutter? When window decorations are enabled the sequence of events is timed differently as the decoration surfaces have to be committed as well.
I don't know if this is a bug here or in kitty. Any suggestions? Now obviously, I can't expect you to read and understand kitty's source but I want to get the conversation started, and I'm happy to do further testing.