Repository: wezterm/wezterm (language: rust)

Issue:
Wrong terminal content placement with versions newer than commit 0184e88 (29. April 2024)
### What Operating System(s) are you seeing this problem on?

Linux X11

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

Xorg 21.1.13 / Xfce 4.18

### WezTerm version

20240508-153238-f6fdfeb9

### 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

When started with --position x,y the terminal content is partially or completely outside the window area:

Examples:
`wezterm start --position 19,72`
![wezterm-20240409-1](https://github.com/wez/wezterm/assets/4973300/3ddeeec9-e90e-454b-863e-ecd746fec603)

`wezterm start --position 19,767`
![wezterm-20240409-2](https://github.com/wez/wezterm/assets/4973300/bf19c62c-5464-42b4-b9d5-55b586074cbc)


### To Reproduce

Start Wezterm with "--position x,y" options.

I don't know which commit exactly broke it but the version 0184e88 from 29. April 2024 works fine.

### Configuration

no config
(Tested WEZTERM_CONFIG_FILE=/dev/null)

### Expected Behavior

Have the terminal content placed correctly inside the window like with 0184e88 or previous versions

### Logs

_No response_

### Anything else?

_No response_


Discussion / hints:
After looking at the offset more closely, the parameters from "--position 19,72" not only get used for the window placement but also as an offset inside the X11 window. That's why the larger value in the 2nd example has no content at all because the offset is outside the visible area.
Ah, sounds like an unanticipated side effect of https://github.com/wez/wezterm/pull/5033
@jknockel could you take a look?

Fix patch:
diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs
index 38da2487698..8b434c32a89 100644
--- a/window/src/os/x11/window.rs
+++ b/window/src/os/x11/window.rs
@@ -1435,8 +1435,8 @@ impl XWindow {
                 depth: conn.depth,
                 wid: child_id,
                 parent: window_id,
-                x: x.unwrap_or(0).try_into()?,
-                y: y.unwrap_or(0).try_into()?,
+                x: 0,
+                y: 0,
                 width: width.try_into()?,
                 height: height.try_into()?,
                 border_width: 0,


Test patch: