wez / wezterm

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

Window Displacement Issue in Fullscreen Mode When Terminal Loses Focus #6275

Open yunxi177 opened 1 month ago

yunxi177 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

20241007-103714-ed430415

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

Window Displacement Issue in Fullscreen Mode When Terminal Loses Focus

To Reproduce

  1. Launch WezTerm and press F11 switch to fullscreen mode.
  2. Perform actions that cause the terminal to lose focus (e.g., switch to another application).

Configuration

local wezterm = require("wezterm")
local config = wezterm.config_builder()

config.keys = {
    { key = "F11", mods = "NONE", action = act.ToggleFullScreen },
}

return config

Expected Behavior

The window should maintain its fullscreen state and alignment without any displacement when focus is lost and regained.

Logs

Debug Overlay wezterm version: 20241007-103714-ed430415 x86_64-unknown-linux-gnu Window Environment: Wayland Lua Version: Lua 5.4 OpenGL: Mesa Intel(R) Graphics (ADL GT2) 4.6 (Compatibility Profile) Mesa 24.2.4-arch1.0.1 Enter lua statements or expressions and hit Enter.

Anything else?

2024-10-14_10-22 The black area in the screenshot is the part that has been offset.

yunxi177 commented 1 month ago

I've made new progress on this issue: the problem occurs only after I use the extension from https://extensions.gnome.org/extension/545/hide-top-bar/ to hide the top bar.

scmx commented 4 weeks ago

Same/similar thing on macOS. The window moves up and down when switching focus back and forth to another monitor. If I have WezTerm running on both monitors in fullscreen they each jump up and down when switching between them 😅 . wezterm-fullscreen-macos-focus-glitch-jumping I have "Automatically hide and show the menu bar" set to Always, but the problem persists if I change it to Never. Do you think it's the same issue? Btw, if Wez sees this, thanks for WezTerm, it was quick and nice to get started with it. ⭐

marekzan commented 3 weeks ago

I have the same issue on endeavouros with gnome and wayland.

My config starts the terminal in window:gui_window():maximize() mode. Loosing focus remains the maximized state. But after I resize the window via Gnomes full-screen command and then lose focus, the window shrinks to about 400x400.

If I disable the config config.window_decorations = "NONE" then the bug is gone.

n-ypy commented 2 weeks ago

I’m experiencing the same issue with the same configuration as @marekzan. Every time I click outside the WezTerm window, it shrinks. To restore the window, I usually have to minimize and then maximize it again.

However, I found a workaround: instead of minimizing, if I click and drag on the WezTerm tab bar, the window will maximize, and the issue won’t happen again until I close the program.