Repository: electron/electron (language: cpp)

Issue:
wayland csd on gnome are broke for 25.x and newer. 
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a bug report that matches the one I want to file, without success.

### Electron Version

25.1

### What operating system are you using?

Other Linux

### Operating System Version

Arch Linux / 6.3.7-zen1-1-zen

### What arch are you using?

x64

### Last Known Working Electron version

24.5

### Expected Behavior

`$ electron24 --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations`
![Zrzut ekranu z 2023-06-14 15-12-55](https://github.com/electron/electron/assets/22305379/6261fe32-040a-4f9b-8e20-601fc4daf2f2)


### Actual Behavior

`$ electron25 --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations`
![Zrzut ekranu z 2023-06-14 15-14-58](https://github.com/electron/electron/assets/22305379/44b87b93-f081-416d-83c1-6d89bde184d1)


### Testcase Gist URL

_No response_

### Additional Information

any electron version newer than 24 (25/alpha-26/nightbuild-27) are broken


Discussion / hints:
Hi-DPI support seems to have been lost in 25 as well, which seems related. The windows have scale 1 even when the monitor has scale 2, thus get upscaled by gnome-shell.

PS: Never mind, the proper scale can be restored with `--disable-features=WaylandFractionalScaleV1` ([chromium issue 1356014](https://bugs.chromium.org/p/chromium/issues/detail?id=1356014#c54)), but this doesn't restore the title bar buttons.
Confirming the lack of title bar buttons on Wayland.

I start my Electron app with `--ozone-platform=wayland --enable-features=WaylandWindowDecorations` and don't get the close, minimize and maximize buttons.

Using GNOME 44.2 with Wayland. Rolling back to version 24 (24.6.1 as of this writing) is a workaround for now.
I've been getting this with Element (im.riot.Riot) too. No buttons, everything else works.

Fix patch:
diff --git a/shell/browser/ui/views/client_frame_view_linux.cc b/shell/browser/ui/views/client_frame_view_linux.cc
index e245f2aa2f6cc..9a52533a5af26 100644
--- a/shell/browser/ui/views/client_frame_view_linux.cc
+++ b/shell/browser/ui/views/client_frame_view_linux.cc
@@ -309,13 +309,13 @@ void ClientFrameViewLinux::PaintAsActiveChanged() {
 
 void ClientFrameViewLinux::UpdateThemeValues() {
   gtk::GtkCssContext window_context =
-      gtk::AppendCssNodeToStyleContext({}, "GtkWindow#window.background.csd");
+      gtk::AppendCssNodeToStyleContext({}, "window.background.csd");
   gtk::GtkCssContext headerbar_context = gtk::AppendCssNodeToStyleContext(
-      {}, "GtkHeaderBar#headerbar.default-decoration.titlebar");
-  gtk::GtkCssContext title_context = gtk::AppendCssNodeToStyleContext(
-      headerbar_context, "GtkLabel#label.title");
+      {}, "headerbar.default-decoration.titlebar");
+  gtk::GtkCssContext title_context =
+      gtk::AppendCssNodeToStyleContext(headerbar_context, "label.title");
   gtk::GtkCssContext button_context = gtk::AppendCssNodeToStyleContext(
-      headerbar_context, "GtkButton#button.image-button");
+      headerbar_context, "button.image-button");
 
   gtk_style_context_set_parent(headerbar_context, window_context);
   gtk_style_context_set_parent(title_context, headerbar_context);


Test patch: