Skip to content
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

KeePassXC cannot detect the Gnome Theme #7817

Closed
izacarias opened this issue Apr 7, 2022 · 7 comments · Fixed by #8477
Closed

KeePassXC cannot detect the Gnome Theme #7817

izacarias opened this issue Apr 7, 2022 · 7 comments · Fixed by #8477

Comments

@izacarias
Copy link

Overview

KeePassXP cannot auto-switch between Light and Dark themes in Gnome 42.0.

Steps to Reproduce

  1. Configure Gnome with the Light theme
  2. Open KeePassXC
  3. Go to Tools Menu -> Theme -> Automatic
  4. Close KeePassXC
  5. Configure Gnome with the Dark theme
  6. Open KeePassXC
  7. KeePassXC is still using the light theme

Expected Behavior

KeePassXC should change to the Dark theme after restarting the application in Gnome using the dark theme.

Actual Behavior

KeePassXC is still using the light theme doesn't matter the theme configured in Gnome.

Context

Just Open the application after changing the Gnome theme (from Light to Dark)

KeePassXC - Version 2.6.6
Revision: 9c108b9

Qt 5.15.3
Debugging mode is disabled.

Operating system: Fedora Linux 36 (Workstation Edition Prerelease)
CPU architecture: x86_64
Kernel: linux 5.17.1-300.fc36.x86_64

Enabled extensions:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (signed and unsigned sharing)
  • YubiKey
  • Secret Service Integration

Cryptographic libraries:

  • libgcrypt 1.10.1-unknown

Operating System: Linux (Fedora Workstation 36)
Desktop Env: Gnome (42.0)
Windowing System: X11

@izacarias izacarias added the bug label Apr 7, 2022
@droidmonkey droidmonkey added duplicate and removed bug labels Apr 7, 2022
@droidmonkey droidmonkey changed the title KeePassXP cannot detect the Gnome Theme KeePassXC cannot detect the Gnome Theme Apr 7, 2022
@droidmonkey droidmonkey reopened this Apr 7, 2022
@mnme
Copy link

mnme commented Apr 7, 2022

Can confirm. There is an even more interesting behaviour when switching themes on-the-fly:

Kooha-04-07-2022-18-47-35.mp4

KeePassXC correctly changes to dark but not back.

@vimpostor
Copy link
Contributor

This is probably a Gnome bug and not a Keepass bug, as foreshadowed in #7422 (comment)

You can test this by running qdbus org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read "org.freedesktop.appearance" "color-scheme" while the light theme is selected. The correct result code would be 2 (Prefer light theme), but if Gnome implements the spec wrong it will return 0 (No preference).

If that is the case, please file a bug report in Gnome. I don't understand how one can get this implementation wrong in the first place: If the user explicitly chooses light theme, the user obviously wants to prefer light theme.

Gnome is then also blatantly lying to the user in the exposed settings: It says "Light" but it actually is a "No-preference" switch.

If Gnome wants to continue making themself the clown in the Linux world, they can continue doing that within the realms of their own DE, but please keep these horribly misguided ideological decisions out of the desktop independent specifications.

But then again, we don't know yet if this is actually just a bug (and hopefully not a deliberate decision), so I don't want to go off the rails yet.

@izacarias
Copy link
Author

@vimpostor Thanks for the explanation.
The qdbus wasn't installed on my system, therefore I had installed it (sudo dnf install qt).

After that I performed the tests you suggested and it seems qdbus is only returning the values
0 -> light theme
1 -> dark theme

So yes, you are right and it isn't a KeePassXC bug, but a Gnome misbehaviour.

Thanks!

@vimpostor
Copy link
Contributor

I mean technically we could workaround the Gnome issue by just considering no-preference as prefers-light. But that would completely reduce the very reason for this setting ad absurdum, as one could have chosen prefers-light to begin with. Instead of reducing this setting to absurdity in all third-party applications, Gnome should just fix this in their own code.

I am curious though what Gnome has to say about this, does there exist a Gnome bug report already?

@izacarias
Copy link
Author

Well... so weird
Setting the theme with
gsettings set org.gnome.desktop.interface color-scheme prefer-dark and gsettings set org.gnome.desktop.interface color-scheme prefer-light, KeePassXC changes the themes accordingly.

However, when I change the theme to dark in the Gnome Settings I get this:

gsettings get org.gnome.desktop.interface color-scheme
'prefer-dark'

Changing back to light theme, I get this:

gsettings get org.gnome.desktop.interface color-scheme
'default'

I'll will try to figure it out on where to report this to Gnome Team :) (I did not check whether a bug report already exists)

Btw, Thanks for this great software (KeePassXC)

@phoerious
Copy link
Member

phoerious commented Apr 8, 2022

"default" seems to be a synonym for "light" then, at least in Gnome terminology.

@scollovati
Copy link

Just adding that Linux Mint with Cinnamon DE has this issue too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants