window_decoration mode "RESIZE" still shows title bar in X11 (Gnome 44, Fedora 38)
What Operating System(s) are you seeing this problem on?
Linux X11
Which Wayland compositor or X11 Window manager(s) are you using?
OS: Fedora 38 Desktop: Gnome 44.2 Window Manager: Mutter
WezTerm version
20230703-132344-9459f64c
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
In Gnome X11, on Fedora 38, the "RESIZE" configuration option for window_decorations is the same as "TITLE | RESIZE" (i.e., resize still shows the title bar).
With window_decorations set to "NONE":
With window_decorations set to "TITLE | RESIZE":
With window_decorations set to "RESIZE":
To Reproduce
Attempt to use window_decorations mode "RESIZE" in Gnome X11 (maybe == Gnome 44?)
Configuration
local config = {
automatically_reload_config = true,
...
window_frame = {
inactive_titlebar_bg = '#353535',
active_titlebar_bg = '#2b2042',
inactive_titlebar_fg = '#cccccc',
active_titlebar_fg = '#ffffff',
inactive_titlebar_border_bottom = '#2b2042',
active_titlebar_border_bottom = '#2b2042',
button_fg = '#cccccc',
button_bg = '#2b2042',
button_hover_fg = '#ffffff',
button_hover_bg = '#3b3052',
border_left_width = '0.25cell',
border_right_width = '0.25cell',
border_bottom_height = '0.125cell',
border_top_height = '0.125cell',
border_left_color = '#bbbbbb',
border_right_color = '#bbbbbb',
border_bottom_color = '#bbbbbb',
border_top_color = '#bbbbbb',
},
...
hide_tab_bar_if_only_one_tab = true,
window_decorations = "RESIZE",
visual_bell = {
fade_in_function = 'Linear',
fade_in_duration_ms = 40,
fade_out_function = 'EaseOut',
fade_out_duration_ms = 150,
},
audible_bell = "Disabled",
warn_about_missing_glyphs = false,
}
return config
Expected Behavior
Window title bar to be hidden as on other platforms when window_decorations is set to "RESIZE"
Logs
No response
Anything else?
I think its possible the motif hints technique used in window/src/os/x11/window.rs doesn't work in Gnome anymore.
This shell command should ostensibly be banging on the same interface and the behavior seems the same (but I don't fully understand it):
xprop -id $(xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2) -format _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 0x4
I've noticed this also; I think Mutter is not respecting the specified WM_HINTS (they are, after all, hints). I don't know if this is a conscious choice on their part, or a regression, but there isn't anything wezterm can do about it.
Thanks! This feels like a perfectly reasonable wontfix; wanted to let you know regardless.
From: Wez Furlong @.> Sent: Wednesday, July 5, 2023 9:53:44 AM To: wez/wezterm @.> Cc: Andy Mauragis @.>; Author @.> Subject: Re: [wez/wezterm] window_decoration mode "RESIZE" still shows title bar in X11 (Gnome 44, Fedora 38) (Issue #3936)
I've noticed this also; I think Mutter is not respecting the specified WM_HINTS (they are, after all, hints). I don't know if this is a conscious choice on their part, or a regression, but there isn't anything wezterm can do about it.
— Reply to this email directly, view it on GitHubhttps://github.com/wez/wezterm/issues/3936#issuecomment-1621810408, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AATYED3VF3RQB2Y2IFODXYTXOVWWRANCNFSM6AAAAAAZ64Y43U. You are receiving this because you authored the thread.Message ID: @.***>
Upstream mutter issue: https://gitlab.gnome.org/GNOME/mutter/-/issues/2912
I am experiencing the same(?) issue in KDE Plasma 5. But I am not too familiar with how window hints are supposed to work. Let me know if I should open a separate issue and what extra debugging information I should provide.
@RuRo I'd suggest looking at the mutter issue and opening a similar issue for KDE Plasma 5. I don't use KDE so I'm not going to be much help beyond this.
Interestingly, it seems that electron apps running under XWayland (which they do by default, since chromium's Wayland support is still WIP AFAIK) somehow get around this issue. Observed with Obsidian specifically.
Edit: Come to think of it, Firefox and Chromium both didn't have this issue when running under XWayland.
Maybe this comment on the mutter issue is related?
Okay, so, small update on this: Running
$ xprop -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS '0x2, 0x0, 0x0, 0x0, 0x0'
and then clicking on the XWayland window removes all window decorations, including the resize handles. Since I use pop-shell for tiling, this is actually acceptable to me. Resizing via window manager still works.
So, I tried setting
config.window_decorations = "INTEGRATED_BUTTONS"
and then checked the window props via xprop, which revealed that _MOTIF_WM_HINTS was still set to '0x2, 0x0, 0x2, 0x0, 0x0', which seems weird to me, since I think that would mean that even with a well-behaved wm, setting window_decorations like above will not have the expected effect on Xorg. Perhaps this was done with the intention to protect users from themselves?
Setting
config.window_decorations = "NONE"
actually doesn't cause this issue! (Edit: I just re-read the original issue, it's mentioned there as well, oops.) It sets _MOTIF_WM_HINTS to '0x2, 0x0, 0x2, 0x0, 0x0' like expected. This will be my workaround for now, I don't really need window decorations for my terminal.
I believe this is where the issue lies:
https://github.com/wez/wezterm/blob/5cccee316aaa6601633af5d993fac400a18ad902/window/src/os/x11/window.rs#L1293-L1297
Mitigating the original issue should be possible by implementing a client-side resize border, which it seems like most applications do that provide client-side decorations on Xorg.
So, if you want to have integrated buttons but don't care for the resize handles, I devised a workaround:
wezterm.on("update-status", function(window)
-- run only once per new window
wezterm.GLOBAL.windows_without_decoration = wezterm.GLOBAL.windows_without_decoration or {}
local window_id = window:window_id() .. ""
if wezterm.GLOBAL.windows_without_decoration[window_id] then return end
-- get all current Xorg windows with their id and their window class
local success, stdout, stderr = wezterm.run_child_process({"wmctrl", "-lx"})
if not success then error("Error running wmctrl: " + (stderr or "")) end
-- iterate lines
for line in string.gmatch(stdout, "([^\n]+)") do
-- filter by window class
if string.find(line, "org.wezfurlong.wezterm") then
-- set wmhints
wezterm.run_child_process {
"xprop",
"-f", "_MOTIF_WM_HINTS", "32c",
"-set", "_MOTIF_WM_HINTS", "0x2, 0x0, 0x0, 0x0, 0x0",
"-id", string.match(line, "([^%s]+)")
}
wezterm.GLOBAL.windows_without_decoration[window_id] = true
end
end
end)
-- window is redrawn when config is reloaded
wezterm.on("window-config-reloaded", function(window)
wezterm.GLOBAL.windows_without_decoration[window:window_id() .. ""] = false
end)
Same happens with me on both Wayland and X11 (Plasma/Tumbleweed) -- Everything is different but same issue, NONE works on X11, but RESIZE and TITLE | RESIZE do not. None of them work on wayland.
wezterm 20240203-110809-5046fc22 Operating System: openSUSE Tumbleweed 20250522 KDE Plasma Version: 6.3.5 KDE Frameworks Version: 6.14.0 Qt Version: 6.9.0 Kernel Version: 6.14.6-1-default (64-bit) Graphics Platform: X11