jnsh / arc-theme

A flat theme with transparent elements (actively maintained fork)
GNU General Public License v3.0
911 stars 75 forks source link

Dark Mode in Gnome Builder stopped working after update to Gnome 42 #193

Closed r7l closed 2 years ago

r7l commented 2 years ago

After updating to Gnome 42, Gnome Builder no longer works as expected with it's dark mode. The way Gnome Builder is providing dark mode changed as well. Prior to 42 it was a single setting working for the entire application. Setting it to dark mode made the entire application appear in Arc Dark even if Arc Darker was set as a system theme. This changed and the old option is only applied to the editor now. The rest of the application now follows what is set in Style option. It's allows to use the new dark style on application basis.

I am am still using Arc Darker as my system theme. It does work as expected in all applications. It actually does work in Gnome Builder the way it is set but setting Gnome Builder to dark mode does no longer work. It also doesn't work if i switch between dark and light mode in Gnome Settings btw. It always stays with Arc Darker.

I've set up the theme as discussed in Arch Forums using GTK_THEME=Arc-Darker environment variable.

I am using Gnome 42 and Gnome Builder 42 on Gentoo with the latest version of Arc Theme.

Screenshots:

prefs builder

jnsh commented 2 years ago

If I'm not mistaken, this has nothing to do with the theme, but the forcing of GTK theme with GTK_THEME environment variable prevents "dark mode" or any other in-application theme switching from working (e.g. theme switching in gtk inspector doesn't work).

I'm assuming the editor gets the dark theme styling from the application, according to its settings (the Color Scheme maybe) and independently from the GTK theme.

You can check this by running unset GTK_THEME, and running gnome-builder from the same terminal session. AFAIK gnome-builder doesn't use libadwaita yet, so the theme selections should work as usual without the environment variable.

For more practical solution/workaround, you could set GTK_THEME=Arc-Dark in the org.gnome.Builder.desktop file, as explained here.

r7l commented 2 years ago

Thanks allot for the info. I wasn't sure where to ask for this issue. Forcing the theme with a global variable isn't the best solution if you ask me. But from what it seems, we have to stick with what the Gnome devs think is best for everyone of us.

I am a bit stuck with this as i've tried to set the env variable .desktop file but it's ignored by Gnome. I don't know why and how. It works perfectly in multiple ways using the terminal. But it doesn't work in any way using a .desktop file. I've tried to set it in ~/.local/share/application/org.gnome.Builder.desktop and even patching the file during package install (which installs the desktop file with changed Exec). It's simply ignored and still called without it.

Unsetting GTK_THEME from ENV does also work but then every GTK4 application will fall back to Adwaita.

jnsh commented 2 years ago

Did you use env in the Exec= line to set the environment variable, as explained on the Arch Wiki page I linked above?

r7l commented 2 years ago

This is what my /usr/share/applications/org.gnome.Builder.desktop file looks like right now. It's installed from the package with my patch applied. There is no other file right now. But having the same file in ~/.local/share/applications doesn't change anything.

[Desktop Entry]
Name[de]=Builder
Name=Builder
Comment[de]=Software für GNOME erstellen
Comment=Build software for GNOME
Exec=env GTK_THEME=Arc-Dark gnome-builder %U
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Builder
DBusActivatable=true
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;Development;IDE;
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords[de]=Erstellen;Entwickeln;IDE;
Keywords=Build;Develop;
MimeType=text/x-c;text/x-csrc;text/x-changelog;text/x-chdr;text/x-c++hdr;text/x-python;application/x-python;application/javascript;application/x-javascript;text/x-javascript;text/javascript;text/x-js;text/x-shellscript;application/x-shellscript;text/x-sh;text/x-vala;text/x-makefile;text/x-c++;text/x-cpp;text/x-c++src;text/css;application/x-gnome-app-info;application/x-desktop;text/x-go;text/html;text/x-markdown;application/json;application/x-m4;application/xml;text/xml;application/x-yaml;text/x-sql;application/x-ruby;text/x-ruby;text/x-pkg-config;text/x-lua;text/x-php;application/x-php;text/x-php-source;application/x-php-source;text/x-perl;application/x-perl;
X-Flatpak-RenamedFrom=gnome-builder
Actions=new-window;create-project;clone-repo;new-editor;dspy;

[Desktop Action new-window]
Name[de]=Ein Projekt öffnen
Name=Open a Project
Exec=env GTK_THEME=Arc-Dark gnome-builder --greeter

[Desktop Action create-project]
Name[de]=Neues Projekt beginnen
Name=Start New Project
Exec=env GTK_THEME=Arc-Dark gnome-builder --create-project

[Desktop Action clone-repo]
Name[de]=Repository klonen
Name=Clone Repository
Exec=env GTK_THEME=Arc-Dark gnome-builder --clone

[Desktop Action new-editor]
Name[de]=Neuer Editor-Arbeitsbereich
Name=New Editor Workspace
Exec=env GTK_THEME=Arc-Dark gnome-builder --editor

[Desktop Action dspy]
Name[de]=D-Bus Inspekteur
Name=D-Bus Inspector
Exec=env GTK_THEME=Arc-Dark gnome-builder --dspy
r7l commented 2 years ago

I've tried the same thing on another non Gnome related application (Geany) and it does work there using .desktop file. I wonder if there is something else for Gnome related applications.

jnsh commented 2 years ago

Sorry, I can't think of why the edited .desktop file wouldn't work. I'm not aware of any reason why some GNOME applications would work differently in this matter.

Either way, this doesn't seem related to the theme any more, so I'm closing this. Please let me know if I still could help with something, or if you figure out the solution to the desktop-file problem in case someone else is struggling with this.

r7l commented 2 years ago

Thanks allot for your help. I've not found the reason for Gnome Builder to act differently then other (non Gnome) GTK applications. For now, i've switched to Geany as i don't want to be bothered by the visual experience of Gnome Builder. It's not my main IDE anyways. I am mostly using it for scripts and stuff like that.

Thanks for the great theme as well.