Open DenysMb opened 1 month ago
Another example of why this is important
It would be nice if there is a setting to remove the title bar all together. It takes up space and doesn't really add anything.
I would also like to have the option to enable a native titlebar/window decoration.
Different Linux Desktop Environments (DE) provide different functionality, some of which include
libdbusmenu
support, I think)None of these features are implemented by the zed titlebar. Instead, these features are currently inaccessible or are only accessible knowing the keyboard shortcut to open a window manager specific window menu (Alt+F3 on KDE/Plasma), if the Linux DE provides such a shortcut.
Applications like Firefox, Chromium, VS Code, Intellij (new UI), and others allow to toggle between an application specific and a native titlebar/window decoration. zed unfortunately doesn't even allow to show the native titlebar/window decoration on top of the application specific toolbar. Instead, the menu option to toggle the native titlebar is disabled in KDE/Plasma's window menu.
To close my post: I do like the editor, which feels more responsive than some editors I am currently (loving that the editor comes with build in VIM mode).
You can actually switch to window decorations by running with ZED_WINDOW_DECORATIONS=server
(original comment)
A setting in settings.json
like VSCode has would still be nice though.
only accessible knowing the keyboard shortcut to open a window manager specific window menu (Alt+F3 on KDE/Plasma), if the Linux DE provides such a shortcut.
FYI Zed actually supports the menu you're talking about.
You can actually switch to window decorations by running with
ZED_WINDOW_DECORATIONS=server
(original comment)A setting in
settings.json
like VSCode has would still be nice though.only accessible knowing the keyboard shortcut to open a window manager specific window menu (Alt+F3 on KDE/Plasma), if the Linux DE provides such a shortcut.
FYI Zed actually supports the menu you're talking about.
Unfortunately, some desktops (GNOME) have not and do not plan to add SSD support on Wayland. Libdecor, however, should work fine.
If you or other contributors are interested, I think the setting ZED_WINDOW_DECORATIONS
should have three options instead of two: client
, server
, and native
, which would use libdecor.
@apricotbucket28 thanks for pointing out the environment variable.
Regarding the window menu: I know that I can access the menu (using the keyboard shortcut) but without setting ZED_WINDOW_DECORATIONS=server
, the option No Titlebar and Frame is disabled. The option is located in the More Actions sub menu.
Wouldn't the following work?
Wouldn't the following work?
if the Wayland compositor supports the [xdg-decoration](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml) protocol, use it for the titlebar to get a native-looking titlebar if the Wayland compositor does not support the protocol (which will be the case for GNOME – they will never implement it), draw client-side decorations
You can already do that with the aforementioned ZED_WINDOW_DECORATIONS=server
environment variable. I don't think anyone is willing to add libdecor support and the Zed team has already said that they want CSD as the default.
I think a setting in settings.json for toggling CSD/SSD would be nice though, and a PR for that would likely be accepted. Something like "window_decorations": "server"
🙂
I understand that Gnome doesn't plan on integrating SSD, but a sizeable chunk of linux users do use Gnome. And if VSCode can draw native titlebars, I don't see why Zed can't implement the same.
I understand that Gnome doesn't plan on integrating SSD, but a sizeable chunk of linux users do use Gnome. And if VSCode can draw native titlebars, I don't see why Zed can't implement the same.
VSCode is an electron app, so it uses the Electron implementation, which builds on Chromium. Zed is novel.
If GNOME users want system window decorations, there are a few possibilities:
Implement libdecor, which provides the decorations. According to @apricotbucket28, there isn't really an appetite for this, but I would note the existence of libdecor-rs, which, while outdated, may still form the basis of a much simpler implementation Unfortunately, libdecor itself is problematic with modern GNOME as it does not support Libadwaita or even GTK4, and GTK3 themes don't solve some very ugly shadows.
Themeable CSD - this is what my money is on, if this problem gets solved. As @apricotbucket28 also said, the Zed team prefers client-side decorations, and this has been a fairly common approach. Many applications (such as Firefox and Chromium, to my knowledge), aren't actually QT or GTK, but simply take the gtk or qt theme's colors and buttons to use in their CSD. LibreOffice takes this even further, with its own GUI toolkit it hooks into GTK and QT not just for CSD but (most?) UI widgets. If Zed's theming capabilities improve to the point icons and spacing can be modified, I would not be surprised if user themes like Zedwaita do so. There are downsides, however. If it is only supported through third-party themes, less popular themes and DEs may not get nice CSD. There may be other discrepancies. Very few apps (Firefox being a recent exception) that don't use libadwaita but imitate it modify corners or shadows to match libadwaita, and other behavior (headerbar color changing when window is focused/unfocused, hovering over close button, etc) might not be implemented.
XWayland - currently, running zed with the envvar WAYLAND_DISPLAY=""
(and ZED_WINDOW_DECORATIONS=server
) still has proper SSD on GNOME. This is what I would recommend to most GNOME users in the present, however xwayland doesn't support fractional scaling well until at least GNOME 47, and even then, I don't know what the results will be on Zed.
GNOME changes their mind and implements xdg-decoration. I hope this will happen, but I don't have much confidence. The GNOME team seems to believe decorations are an essential part of modern (Wayland) applications, so only xwayland, which is intended for legacy applications that don't support wayland, can have SSD.
After writing this out, I get the feeling there should be a separate issue thread, titled something like "Better/Themeable CSD on Linux" or "Native (style) decorations on GNOME". Zed already supports disabling CSD and enabling a native titlebar through the env var, as has been mentioned. What is there to discuss other than adding it to the Zed settings?
Check for existing issues
Describe the feature
Hello!
Would be nice if we have an option to disable the client side decoration (enable the default native titlebar).
This way, we could integrate the editor way better with the environment.
Here is an example of VS Code using native titlebar instead of its own:![image](https://github.com/zed-industries/zed/assets/33737137/4747e50a-ca70-46f2-9bdc-58fbde18c279)
And here is Zed:![image](https://github.com/zed-industries/zed/assets/33737137/77549ee2-c2ae-4ffc-acf9-1b05f5842fed)
The window buttons (to close, minimize and maximize) are different and the border radius are different. With others windows opened, it looks out of place.
If applicable, add mockups / screenshots to help present your vision of the feature
No response