wez / wezterm

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

Moving a WezTerm window between monitors causes erratic jumping and resizing of the window #1983

Open lsorber opened 2 years ago

lsorber commented 2 years ago

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

macOS

WezTerm version

20220512-142730-97f0bd16

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

I have noticed several distinct issues related to how the WezTerm window is rendered.

On an external monitor on macOS:

  1. The window padding (set at a fixed 40px) is clearly larger on the external monitor compared to my laptop's display.
  2. Moving the WezTerm window around with the mouse by dragging the tab bar causes the window to jump around.
  3. Moving the WezTerm window close to the virtual boundary between my external monitor and laptop's display causes erratic resizing behaviour.

None of these issues occur on my MacBook Pro's display.

Video demonstrating these issues:

https://user-images.githubusercontent.com/4543654/168260141-1c5735f3-eed2-4a77-baa3-30c218469fc7.mp4

To Reproduce

  1. Open a WezTerm window
  2. Move the WezTerm window to an external monitor to observe issue (1)
  3. Drag the WezTerm window around on the external monitor to observe issue (2)
  4. Drag the WezTerm window to near the virtual boundary between the external monitor and the internal display to observe issue (3)

Configuration

local dracula = require 'dracula'; -- https://github.com/dracula/wezterm
local wezterm = require 'wezterm';

return {
  colors = dracula,
  font = wezterm.font("FiraCode Nerd Font", {weight="Medium"}),
  font_size = 16.0,
  initial_cols = 80,
  initial_rows = 24,
  show_tab_index_in_tab_bar = false,
  window_decorations = "RESIZE",
  window_frame = {
    font_size = 16.0,
    active_titlebar_bg = "#282a36",
    inactive_titlebar_bg = "#282a36",
  },
  window_padding = {
    left = "40px",
    right = "40px",
    top = "40px",
    bottom = "40px",
  },
  keys = {
    { key="LeftArrow",  mods="OPT", action=wezterm.action{SendString="\x1b\x62"} },
    { key="RightArrow", mods="OPT", action=wezterm.action{SendString="\x1b\x66"} },
    { key="LeftArrow",  mods="CMD", action=wezterm.action{SendString="\x01"} },
    { key="RightArrow", mods="CMD", action=wezterm.action{SendString="\x05"} },
    { key="z",          mods="CMD", action=wezterm.action{SendString="\x1f"} },
  },
}

Expected Behavior

  1. That the window padding is the same size independent of the display or DPI
  2. That the window doesn't jump around when dragging the window
  3. That the window doesn't resize when dragging the window

Logs

I don't see any logs being generated when reproducing this issue.

Anything else?

No response

cgraff commented 1 year ago

Hello and good evening!

I can reproduce the issue easily (independently of internal / external monitor) on my MacBook Pro Display just by hiding the window decorations by setting the following config property:

config.window_decorations = 'RESIZE'

WezTerm Version

My current version is: wezterm 20230408-112425-69ae8472

MacOS Version

Ventura 13.3.1(a) (Apple Silicon)

wez commented 1 year ago

@cgraff please open a separate issue; this one is specific to having multiple monitors

cgraff commented 1 year ago

Hi @wez thanks for the hint. I think the problem went away after updating my Mac to MacOS 13.4. Cannot reproduce it anymore :-)

thiagodiniz commented 2 months ago

I have the same problem using with windows 11

mikkelam commented 3 weeks ago

I can confirm this as a problem on my 2560 x 1440 monitor. Changing resolution to half 1280 x 720 seems to resolve the issue (but other scale factors have similar issue for me)

PiotrNawrot commented 3 weeks ago

This is still an issue for me as well!

nbelakovski-mssm commented 2 weeks ago

I have this same problem, but I noticed that if I click and drag using the tab title, there's no jump. I opened up some more tabs and confirmed that clicking on any tab and dragging works as expected (it also selects that tab which is understandable). I tried clicking and dragging on the area without tabs while multiple tabs were open, in the hopes that maybe just having a second open tab could be a workaround, but it still jumps.