neovide / neovide

No Nonsense Neovim Client in Rust
https://neovide.dev
MIT License
12.71k stars 515 forks source link

Allow to customize X11 “WM_NAME” (window title) #1904

Open unclechu opened 1 year ago

unclechu commented 1 year ago

Is your feature request related to a problem? Please describe.

I’m using Rofi to navigate between windows utilizing fuzzy search over their titles. Also I have a currently focused window title on the WM’s bar. It would be more useful if I could customize the window title (WM_NAME).

Describe the solution you'd like

Window title (WM_NAME) is customizable the same way WM_CLASS can be customized (via --x11-wm-class command-line argument option).

Describe alternatives you've considered

Just customizing WM_CLASS. It’s not perfect since Rofi renders it in a separate column, and when the names are long it’s kind of shifting everything. All the other apps have a short WM_CLASS, just the app name. Also the bar (in my case, with other WMs it can be a part of the window border) shows only the window title, it does not show the class. Using the title to adding different kind of markers seems more suitable.

unclechu commented 1 year ago

I was trying to have a look if I can implement it myself. But it seems it’s not that straightforward as there is no dedicated method to set the WM_NAME specifically. And there is no method to set an arbitrary X11 property:

https://docs.rs/winit/latest/winit/platform/x11/trait.WindowBuilderExtX11.html

unclechu commented 1 year ago

I probably don’t understand well-enough how X11 works but setting the WM_NAME like this xprop -set WM_NAME testing (and clicking on the Neovide window then) sets the property but does not actually change the window title. :thinking: Though this WM_NAME appears on my Rofi navigation between windows list.

I see that the default title is set by window::WindowBuilder::new().with_title("Neovide") method call. But I can’t see it anywhere in the props when I do xprop inspection on the Neovide window.

unclechu commented 1 year ago

To me it seems that any other application (e.g. such as Firefox) set both the WM_NAME property and this window title that does not appear in the list of properties to the same value.

unclechu commented 1 year ago

I created a merge request for customizing the window title: https://github.com/neovide/neovide/pull/1907

But the WM_NAME is still not set. It (the window title column) renders empty in the rofi --show window list of options for instance. So it kind of a step towards closing the issue but it does not closes it yet.

unclechu commented 1 year ago

I created an issue for winit addressing the WM_NAME property customization issue: https://github.com/rust-windowing/winit/issues/2892