-
-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes on Sway - not divisible by scale 2 #2445
Comments
Please launch wezterm with |
Here are the full logs, but here are the last few lines, it seems like there is an issue when the buffer size is not dividable by 2.
|
Also unrelated, but would you be open to a pr to suppress the OSC warning with OSC 697 (Fig's proprietary OSCs) |
Yeah, however: some of them (most of them?) map to iTerm2 OSCs and could actually be handled the same way. |
Issue sounds similar to: |
sway 1.8 is released and this is still reproducible. |
I'm still getting this as well, after installing
|
Same here
|
Starting wezterm with the line |
|
@q234rty Thank you I'm going to reopen the one. |
I see a slightly different error message. In my case, it usually happens some time after unplugging external display, so many instances of the wezterm get resized because of different resolutions.
More logs: This is from Arch's wezterm-git This one is from stable release: |
So, looking at the logs when this happens it seems the sequence of events is:
Now that the surface has content, the compositor maps the window and sends a
At this point Wezterm has committed a 517×36 buffer with scale 2, and the compositor sends a protocol error. This can also happen when moving a window from a scale-1 output to a scale-2 output; the I've not traced the wezterm code, but I suspect that the (The crash on initial surface construction is kinda a consequence of this protocol bug - wezterm cannot know what buffer scale to use without first committing a buffer to the surface - but the solution is the same for both the initial creation and the move-to-different-output cases). |
This is easily reproducible on my laptop's screen (scaling 1.5) under latest sway etc. If I have a screen with one wezterm running and try to launch another one, they both crash. The workaround noted by @gfauredev works for me. |
And now this is crashing on Gnome Shell 44.2, taking the entire Gnome Wayland session down with it. |
@gfauredev solution works!
|
Currently, I just set |
I can duplicate this on demand with the following steps, running sway:
wezterm.log I also confirm changing my sway hotkey to pass |
It seems like this issue was worked around in imv by this patch. https://lists.sr.ht/~exec64/imv-devel/patches/38286 @@ [550](https://git.sr.ht/~exec64/imv/tree/4448fb6104d67e3dfff3e71babe257992fce5560/item/src/wl_window.c#L550),8 [550](https://git.sr.ht/~exec64/imv/tree/1817ef3df12a1c03d8642291eb7facd42c0f5580/item/src/wl_window.c#L550),6 @@ static void update_scale(struct imv_window *window)
if (new_scale != window[-](https://git.sr.ht/~exec64/imv/commit/1817ef3#src/wl_window.c-1-4)>scale) {
window[-](https://git.sr.ht/~exec64/imv/commit/1817ef3#src/wl_window.c-1-5)>scale = new_scale;
wl_surface_set_buffer_scale(window->wl_surface, window->scale);
- wl_surface_commit(window->wl_surface);
- wl_display_roundtrip(window->wl_display);
size_t buffer_width = window->width * window->scale;
size_t buffer_height = window->height * window->scale;
wl_egl_window_resize(window->egl_window, buffer_width, buffer_height, 0, 0); There's another patch that seemed to help mpv work around this: These could be helpful in fixing, though I don't know exactly where to edit the source in wezterm. |
Ok, I'm not Wayland expert but I've been reading, so here's my amateur assessment. It seems like before a commit is made to a surface, the width and height must be divisible by the scale before a commit. This must mean the error occurs because a buffer that is not divisible by the scale has been committed, but why? I'm think I have no choice but to set breakpoints on every commit and see what the state of the pending scale, width, and height are. Anyway, I'll have to revisit this another time, but I'll leave this here for future reference. Here's a list of all the projects that have fixed this particular issue. |
What Operating System(s) are you seeing this problem on?
Linux Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
sway version 1.8-dev-6e023257
WezTerm version
wezterm 20220821-181413-35ed9ac1
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
Wezterm crashes when multiple windows are opened in a vertical layout in Sway
Seems related to #1144
To Reproduce
No response
Configuration
Happens with and without config
Expected Behavior
No response
Logs
Anything else?
No response
The text was updated successfully, but these errors were encountered: