FULLSCREEN-BUG: Wezterm resizing to unmaximized-size after tabbing out and back in during fullscreen
What Operating System(s) are you seeing this problem on?
Linux X11, Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
$ echo $XDG_SESSION_TYPE
wayland
$ apt-cache show mutter | grep Version
Version: 42.9-0ubuntu5
Version: 42.0-3ubuntu2
$ xdpyinfo | grep version
version number: 11.0
X.Org version: 1.22.1.1
WezTerm version
20230712-072601-f4abf8fd
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
No, and I'll explain why below
Describe the bug
The bug occurs when:
- wezterm is in fullscreen
- I'm tabbed out of wezterm
- I tab back into wezterm
The bug is that wezterm appears to remain in fullscreen yet the window size shrinks back to the size it was before entering fullscreen. I am not aware if alt+enter fires ToggleFullScreen but that toggles the bug as well.
To Reproduce
To reproduce the bug
- start wezterm
- enter fullscreen with ToggleFullScreen
- Tab out to another window
- Tab back into wezterm
The bug occurs.
Configuration
no config
Expected Behavior
Wezterm window should remain fullscreen-sized when in fullscreen mode, regardless of external factors.
Logs
No response
Anything else?
The bug is resolved/corrected by two things:
- click and drag on the window top bar, to try and move the window. Since it still is in fullscreen, wezterm won't move but the size will take back the entire screen.
- exit fullscreen then enter it again. Gets tedious since I tab out and in a lot, especially when browsing the internet.
Note: If I use the first option (click and drag the top bar) the bug no longer occurs. Until I exit and re-enter fullscreen, at which point I'd have to fix it the same way again.
Images of the bug:
Screencast from 11-12-23 19:17:39.webm
(note: at end of video above. fixed by using method one mentioned above. click and drag on the top bar)
Can trigger this with echo foo | wl-copy, the state stays in maximized.
I'm experiencing the same issue on 20240203-110809-5046fc22. I have the same Wayland version (mutter) as described in this issue.
Would love to know if there's a fix or a workaround to this!
I tried the WebGpu frontend but that didn't solve it. Also tried the nightly build but there are other issues on it preventing me to go to fullscreen (+ no title bar)
I added this to my config so that when the window to alleviate some of the effects caused by this bug. Whenever you re-focus wezterm, it will go back to full screen. You can remove the logs if you want.
wezterm.on('window-focus-changed', function(window, pane)
local window_dims = window:get_dimensions()
wezterm.log_info('FOCUS called!', string.format('Is focused: %s', window:is_focused()),string.format('Is full screen: %s', window_dims.is_full_screen) )
if window_dims.is_full_screen then
window:toggle_fullscreen()
wezterm.log_info(string.format('force toggle full screen and maximize. New is full screen: %s', window:get_dimensions().is_full_screen))
end
end)
Looks like even when window focus is lost, the is_full_screen stays true. Also, it looks like even after calling window:toggle_fullscreen(), is_full_screen stays true. Only my keybind action seems to change the state of is_full_screen.. Either wayland does some weird stuff with wezterm or this function is a setter, not a toggle.
Anyways, this means we can use is_full_screen to know whether if we should actually be in fullscreen. And we can use toggle_fullscreen() to go to full screen, on each focus change, without actually changing the state of is_full_screen.
This is all weird behavior to me, and this function is a super hacky "fix". I'm not entirely sure what's going lol. Use at your own risk!
I completely resolved the issue by updating from Ubuntu 22.04 to 23.10. Having a more recent versions of GOME mutter fixes this issue. I'm now on Version 45.2-0ubuntu4
I also have this issue on Fedora 40, wayland, wezterm 20240624_065522_552bb1d6. I'm using mutter 46.2.
I attempted to use the fix above, which did not work.
Upon further investigation, window:toggle_fullscreen() wasn't working (I use the gnome built-in shortcut (Super + Up) to maximize the window, so I never noticed before). Additionally, is_full_screen always remains false.
The first fix mentioned above (clicking and dragging) works for me.
Can trigger this with
echo foo | wl-copy, the state stays in maximized.
For me as well. wl-copy and wl-paste also make wezterm exit fullscreen mode
Another observation: in this view gnome UI elements around the window are placed as if it wasn't fullscreen
Duplicate of https://github.com/wez/wezterm/issues/4568
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.