You are not logged in.

#1 2024-01-02 17:12:38

Ambos
Member
Registered: 2024-01-01
Posts: 5
Website

[SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

Hi!

After using Gradience from the AUR for a bit, I decided to go back to the default Adwaita look. So, I followed the procedure on the Gradience Github page. After that, I was unable to switch to the dark theme from GNOME Settings. At first, I tried to restart the X session but it didn't fix it. Then, I asked about that issue on the Gradience Discord server but I was told it wasn't related to the app since it only touches the files mentioned in the README.

I also created settings.ini inside ~/.config/gtk-4.0 with the following content:

[Settings]
gtk-application-prefer-dark-theme=1

But, it didn't solve it either. GTK3 apps aren't affected as I can instantly switch from the dark to the light theme using the option inside GNOME Settings. I should also add that I have adw-gtk3 installed from the AUR and set the "Legacy Applications" theme to "Adw-gtk3-dark" inside GNOME Tweaks.

After shelving these problems for a while, I stumbled upon the following thread which describes a situation similar to mine:
https://bbs.archlinux.org/viewtopic.php?id=281646

I also have similar results when running gsettings:

$ gsettings get org.gnome.desktop.interface gtk-theme
'adw-gtk3-dark'
$ gsettings get org.gnome.desktop.interface gtk-key-theme
'Default'
$ gsettings get org.gnome.desktop.interface color-scheme
'prefer-dark'

But forcing a GTK4 app to use the "Adw-gtk3-dark" theme, instead of "Adwaita:dark", gives it a GTK4 style.

$ GTK_THEME='adw-gtk3-dark' gnome-extensions-app

Is there a proper way to fix the theming issue and the switch in GNOME Settings? Or, do I have to fiddle with the GTK theme environment variable?

Last edited by Ambos (2024-01-08 09:06:34)

Offline

#2 2024-01-02 18:14:18

cooldudeseven7
Member
Registered: 2024-01-02
Posts: 60

Re: [SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

This might help. https://bbs.archlinux.org/viewtopic.php?id=291583

I had the same problem. But, i am not sure about GTK. Do you have the (gnome) dark theme on?
Please note, Apps like kdenlive are QT, not GTK.

Offline

#3 2024-01-02 20:51:45

seth
Member
Registered: 2012-09-03
Posts: 52,269

Re: [SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

Check your pacman log what kind of flatpak/xdg-desktop-portal packages were installed w/ the gradience stuff
https://bbs.archlinux.org/viewtopic.php?id=289408

Offline

#4 2024-01-03 16:06:15

Ambos
Member
Registered: 2024-01-01
Posts: 5
Website

Re: [SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

cooldudeseven7 wrote:

This might help. https://bbs.archlinux.org/viewtopic.php?id=291583

I had the same problem. But, i am not sure about GTK. Do you have the (gnome) dark theme on?
Please note, Apps like kdenlive are QT, not GTK.

I have the GNOME dark theme turn on indeed. I was only talking about the GTK4 apps as I didn't change anything related to QT apps theming.

seth wrote:

Check your pacman log what kind of flatpak/xdg-desktop-portal packages were installed w/ the gradience stuff
https://bbs.archlinux.org/viewtopic.php?id=289408

I never installed any flatpak on my PC (I still checked my pacman log). But I installed xdg-desktop-portal-gtk and xdg-desktop-portal-gnome while trying to solve an issue related to file uploads from the Steam client. I only have xdg-desktop-portal now.

$ pactree -r xdg-desktop-portal 
xdg-desktop-portal
├─gnome-clocks
└─libportal
  ├─libportal-gtk3
  │ └─file-roller
  └─libportal-gtk4
    ├─bottles
    └─gradience-git

Last edited by Ambos (2024-01-03 16:11:05)

Offline

#5 2024-01-03 21:25:36

seth
Member
Registered: 2012-09-03
Posts: 52,269

Re: [SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

Check the log (/var/log/pacman.log, plain text) what appeared and disappeared when and from the other thread and on a limb: re-install xdg-desktop-portal-gtk

Offline

#6 2024-01-08 09:05:49

Ambos
Member
Registered: 2024-01-01
Posts: 5
Website

Re: [SOLVED] Dark theme switching issue with GTK4 applications on GNOME 45

seth wrote:

Check the log (/var/log/pacman.log, plain text) what appeared and disappeared when and from the other thread and on a limb: re-install xdg-desktop-portal-gtk

Thank you, I solved the issue by reinstalling xdg-desktop-portal-gnome and restarting my GNOME session.

Offline

Board footer

Powered by FluxBB