wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.65k stars 745 forks source link

Maximized Wayland Wezterm renders as windowed after switching Gnome workspace #5901

Open aliaksandr-trush opened 1 month ago

aliaksandr-trush commented 1 month ago

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

Mutter

WezTerm version

20240804_002145_1711261a

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

If I maximize Wezterm window on some Gnome workspace, and then switch to some another Gnome workspace, Wezterm become "windowed" again. But Gnome (Mutter) still thinks that window is maximized (to restore Maximized window state, I have to do Restore -> Maximize actions).

To Reproduce

  1. Run Wezterm
  2. Make it Fullscreen or Maximized
  3. Switch Gnome Workspace to another workspace
  4. Return to Workspace with Wezterm

Configuration

local config = wezterm.config_builder() config.initial_cols = 140 config.initial_rows = 60 config.automatically_reload_config = false

config.window_padding = { left = 0, right = 0, top = 0, bottom = 0 }

Expected Behavior

Wezterm should be rendered as Maximized/Fullscreen after Gnome Workspace switch

Logs

stderr.txt

Anything else?

X11 Wezterm works as expected. (enable_wayland=false)

aliaksandr-trush commented 1 month ago

Looks like Configure event for FULL_SCREEN and MAXIMIZED contains new_size for Windowed window, and dimensions for real screen size could be fount in suggested_bounds:

19:22:09.146 TRACE window::os::wayland::window > Pending configure: w:1260, h1080 -- Some(Window(WindowInner { xdg_surface: XdgShellSurface { xdg_surface: XdgSurface { id: ObjectId(xdg_surface@24), version: 6, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { inner: (Weak) } } }, surface: Surface(WlSurface { id: ObjectId(wl_surface@23), version: 6, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { inner: (Weak) } } }) }, xdg_toplevel: XdgToplevel { id: ObjectId(xdg_toplevel@25), version: 6, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { inner: (Weak) } } }, toplevel_decoration: None, pending_configure: Mutex { data: WindowConfigure { new_size: (Some(1260), Some(1080)), suggested_bounds: Some((1920, 1168)), decoration_mode: Client, state: WindowState(ACTIVATED), capabilities: WindowManagerCapabilities(WINDOW_MENU | MAXIMIZE | FULLSCREEN | MINIMIZE) }, poisoned: false, .. } }))

Added commit with fix to me PullRequest for Wayland FULL_SCREEN #5897