Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

_GTK_THEME_VARIANT xprop ignored on Fedora 38 #57

Closed
subpop opened this issue Apr 20, 2023 · 5 comments
Closed

_GTK_THEME_VARIANT xprop ignored on Fedora 38 #57

subpop opened this issue Apr 20, 2023 · 5 comments

Comments

@subpop
Copy link

subpop commented Apr 20, 2023

It looks like the xprop _GTK_THEME_VARIANT is ignored by clients on Fedora 38. I've verified that the property _GTK_THEME_VARIANT is set to dark:

[link@localhost ~]$ xprop -name 'Visual Studio Code' | grep GTK_THEME
_GTK_THEME_VARIANT(UTF8_STRING) = "dark"

But the window title bar is still light.

@fkrull
Copy link
Owner

fkrull commented Apr 22, 2023

Huh, thanks for the report. I'm gonna look into it, buuuuut if it doesn't work it doesn't work. Not even setting GTK_THEME=Adwaita:dark works, that makes the menu bar and Gtk dialogs dark, but the titlebar stays light.

I'll try and see if I can find out what changed, but maybe don't get your hopes up. Given there hasn't been a Wayland equivalent of this setting, I wouldn't be surprised if Gtk removed it on the X11 side as well. :\

@fkrull
Copy link
Owner

fkrull commented Apr 22, 2023

Ok so I think this is a consequence of https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2175. Mutter/GNOME Shell changed the way they draw window borders for X11 windows that don't draw their own window borders. There's a followup MR that has a comment mentioning that the _GTK_THEME_VARIANT property doesn't work any more.

I guess that means this extension has now outlived its usefulness. 🤷 Maybe it's possible to add back support for _GTK_THEME_VARIANT to Mutter, but the effort seems better spent finally fixing this upstream in VSCode.

I don't have the bandwidth for that tho, so I guess I'll add a big fat deprecation notice to the readme and get used to mismatching titlebars.

@westurner
Copy link

Is there a vscode issue for this?

Changing window.titleBarStyle from native to custom seems to hide the light File menu titlebar which seems to work around the problem?

"window.titleBarStyle": "custom"

That could just be the default in the Flatpak repack of vscode?

@westurner
Copy link

FWIW it looks like flatpak install flathub com.vscodium.codium installs org.gtk.Gtk3theme.Adwaita-dark, but IDK where that's specified if not in the flatpak?

One workaround for missing Adwaita-dark theme in the flatpak is to instead install vscode in a container (possibly managed with toolbox to mount $HOME within the container with the correct uid; instead or in addition to Dev Containers / ). But the vscode flatpak should be enough to host a lightweight vscode frontend with "Remote " extensions I need to catalog the links of anyway; and There are probably not integration tests for these extensions which support host isolation, that may be run in the flatpak:

@fkrull
Copy link
Owner

fkrull commented Sep 20, 2023

Is there a vscode issue for this?

From a brief search:

There's probably more tbh. Turns out Chromium's OS integration on Linux kinda sucks ass. 🤷

Changing window.titleBarStyle from native to custom seems to hide the light File menu titlebar which seems to work around the problem?

Yeah, that makes VSCode draw the titlebars which means they match the VSCode theme. The downside is that they look and act different from either WM-drawn decorations for GTK client-side decorations.

FWIW it looks like flatpak install flathub com.vscodium.codium installs org.gtk.Gtk3theme.Adwaita-dark, but IDK where that's specified if not in the flatpak?

I think that's Flatpak's theme installation magic. I believe it determines what theme you have set and installs the corresponding extension from Flathub.

@fkrull fkrull closed this as completed Aug 5, 2024
@fkrull fkrull closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants