-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Add Titlebar support for Wayland #27016
Comments
On vscode you can fix it using this setting:
|
GTK4 provides many components besides the headerbar itself. For example, you can define a handle area overlaid on top of your webview and add window buttons somewhere, thus getting a result similar to what MacOS Electron apps offer nowadays instead of a classic (even if CSD) title bar. Indeed, the headerbar widget is composed of these smaller parts that are also separately available. I've been doing some experiments and all this is easily achievable. Now the bad part: the surfaces you get from Chromium/Electron are no GTK at all, not even the container is GTK, it's all done at the Aura/Ozone level AFAICS. So there is no place where to hook these GTK goodies. I've been inspecting the MacOS implementation in Electron and they seem to have reimplemented the entire NativeWindow in order to have a NSView, I guess something like that would be required to introduce a GTK container at the top of the hierarchy. That's a lot of complex work, I don't think it will come from an individual community contributor anytime soon. OTOH, Chromium has its own rendering of window buttons that, although not perfect, does its best to follow the system theme. Maybe these parts could be reused, although they seem to be pretty intertwined with the browser windows, tab bar, etc. |
@4ndv's workaround is the only thing that works until the fix hits the latest bin. |
Electron can now be built with Wayland support. One problem is that it does not support drawing a title bar for any applications using it. according to: microsoft/vscode#124202 (comment) > This is a well known issue. Gnome under Wayland does not support server side decorations, which is a problem for all Electron apps that don't implement client side decorations (which VSCode does). ref: electron/electron#27016 On vscode you can fix it using this setting: ``` "window.titleBarStyle": "custom" ``` so here we following the fix up
This was implemented in #29618, currently under a feature flag ( |
Since #29618 has been merged, I'm closing this issue. Do let me know if this needs to stay open! |
Hey folks! First - thank you for this incredibly descriptive issue - I found myself here when, upon setting the I'm still experiencing this issue on Fedora 37 / Gnome 43 / Wayland / Nvidia (via akmod). VSCode version details as follow:
The:
workaround resolves my issue, but isn't ideal. @RaisinTen Does anything look awry with my configuration that could cause me to experience this issue after the Electron issues were resolved and flagged properly? Let me know if I can provide any additional information - or try anything to resolve! Thanks folks! |
Interesting. @deepak1556 any clue? |
@gurnben, try it like:
In my experience with vscode, I had to install the |
@sepehr Ah! Thanks for the tip! I've switched to using:
and the Title Bar is back (upon switching from custom to native) but I have another odd issue... This is what full screen looks like now on both my ultrawide and standard display (complete with the border): |
Not sure what is the problem you are referring to. Your title bar looks good to me tbh. Here's mine using insiders build: |
@sepehr thanks for the suggestion - I'll give the insider build a try later today! The issue is actually that, with Let me know if that makes sense - if not I can attach an annotated screenshot! In the meantime - I'm off to the insider build! |
Ok - I've given code-insiders a try. I've tried a number of combinations with interesting results (all with
Let me know if you have any suggestions on what to try next (or debug info I can provide) to get to the bottom of that 10 pixel border! |
See this issue #33161 Not sure if this is a regression or if you are using an old version of Electron. |
Incredible - thank you for the issue link @kaimast! Would you like me to move the discussion to that issue? I'm currently on:
on GNOME 43.2 In theory - Electron 19.1.8 should contain all fixes discussed in #33161 (just looking through the commits before the 1.19.8 tag here. |
Electron (with some finagling) can now be built with Wayland support.
One problem is that it does not support drawing a title bar for any applications using it. Either requiring the application to call for the draw or having the window manager draw one (Client Side Decorations (CSD) and Server Side Decorations (SSD)), and unfortunately some applications have not implemented CSD (Discord, Vscode).
Deciphering the conversation from #10915 it seems that Chromium already supports CSD through GTK (which would be 'ported'?). And failing that it seems that gnome does provide the library libdecoration.
Here is an example of a native Wayland window without a titlebar.
The text was updated successfully, but these errors were encountered: