Bug 497790 - KColorSchemeWatcher fails to read initial XDG dark mode value with Frameworks 6.9
Summary: KColorSchemeWatcher fails to read initial XDG dark mode value with Frameworks...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kguiaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.9.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-12-22 18:17 UTC by Giusy Digital
Modified: 2025-01-08 22:08 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.10
Sentry Crash Report:


Attachments
Fedora 41 dark mode change (402.87 KB, video/mp4)
2025-01-04 06:44 UTC, Ilya Fedin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giusy Digital 2024-12-22 18:17:44 UTC
SUMMARY
From Kirigami 6.8.0 update, the dark mode is not working anymore on Kirigami apps inside Gnome Desktop.

I tested the new Qt port of Easy Effects on the previous 6.7.0 version and the dark mode was correctly applied when the dark style was selected in the Gnome system settings. From 6.8.0 update, the dark mode is not applied anymore and I also tested Alligator (which is a Kirigami app either) and it still lacks the dark mode. 

STEPS TO REPRODUCE
1. Open a Kirigami app in Gnome with dark style set on.

OBSERVED RESULT
The app uses the light theme

EXPECTED RESULT
The app should use the dark theme
Comment 1 Wellington Wallace 2024-12-22 18:24:11 UTC
I did some tests on my laptop where I still have GNOME. Alternating between light and dark theme on GNOME settings works. But as soon as the app is closed and opened again Kirigami takes the light theme instead of the dark one that was set previously. Somehow the configuration is not persistent.
Comment 2 Nate Graham 2025-01-03 20:27:54 UTC
Possibly related to Bug 496174, which also went in for 6.8 and apparently affected colors for phople using KDE apps outside of Plasma.
Comment 3 Ilya Fedin 2025-01-04 06:44:00 UTC
Created attachment 177091 [details]
Fedora 41 dark mode change

FWIW, I can't reproduce with Fedora 41.
Comment 4 Ilya Fedin 2025-01-04 07:01:01 UTC
It has KF 6.9.0
Comment 5 Giusy Digital 2025-01-04 09:49:05 UTC
Arch also has Kirigami 6.9.0: https://archlinux.org/packages/extra/x86_64/kirigami/

But I still have the issue on Gnome 47. Maybe I miss a required package, who knows. There would be interesting to know which files are installed in the Kirigami package on Fedora. Unfortunately I don't know where to check this information whereas the Arch website provides the list of installed files for every package.
Comment 6 Giusy Digital 2025-01-04 09:57:51 UTC
Alligator on Arch (https://archlinux.org/packages/extra/x86_64/alligator/) installs the following dependencies: kcolorscheme, kconfig, kcoreaddons, ki18n, kirigami, kirigami-addons, qt6-base, qt6-declarative.

Are those enough in your opinion? I have also kiconthemes, kconfigwidgets, qqc2-desktop-style and breeze-icons installed.
Comment 7 Ilya Fedin 2025-01-04 10:05:02 UTC
I would rather guess that you have a non-standard configuration you haven't mentioned. E.g. kvantum is known to cause problems due to its hunger to force-override the palette.
Comment 8 Ilya Fedin 2025-01-04 11:19:29 UTC
Nevermind, I managed to reproduce. Are you sure it's since 6.8.0? I would rather suspect kguiaddons 6.9.0, https://invent.kde.org/frameworks/kguiaddons/-/commit/91c23a57f39103201d305480eb24039942a376ad
Comment 9 Giusy Digital 2025-01-04 11:43:50 UTC
(In reply to Ilya Fedin from comment #7)
> I would rather guess that you have a non-standard configuration you haven't
> mentioned. E.g. kvantum is known to cause problems due to its hunger to
> force-override the palette.

No, it's just plain Gnome, no kvantum or QAdwaita installed.

(In reply to Ilya Fedin from comment #8)
> Nevermind, I managed to reproduce. Are you sure it's since 6.8.0? I would
> rather suspect kguiaddons 6.9.0,
> https://invent.kde.org/frameworks/kguiaddons/-/commit/
> 91c23a57f39103201d305480eb24039942a376ad

You're right, it's my mistake. It's the 6.9.0 version released in Arch in December 14 and I saw the issue a couple of days later.
Comment 10 Giusy Digital 2025-01-04 11:49:27 UTC
Okay, downloaded the kguiaddons 6.8.0 from Arch archive and installed on my system. Kirigami apps are launching in dark mode.
Comment 11 Ilya Fedin 2025-01-04 12:50:15 UTC
Can you confirm that reverting the commit fixes the issue?
Comment 12 Giusy Digital 2025-01-04 13:14:02 UTC
(In reply to Ilya Fedin from comment #11)
> Can you confirm that reverting the commit fixes the issue?

Installing the 6.8.0 package I don't have confirmation. Maybe I should clone the kguiaddons-git from AUR and apply a patch prior to install it.
Comment 13 Ilya Fedin 2025-01-04 13:17:42 UTC
Yeah, should work
Comment 14 Giusy Digital 2025-01-04 18:56:40 UTC
(In reply to Ilya Fedin from comment #13)
> Yeah, should work

Indeed, I reverted that commit, compiled and installed on my system. It's fixed.
Comment 15 Bug Janitor Service 2025-01-08 16:05:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/156
Comment 16 Bug Janitor Service 2025-01-08 16:35:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/157
Comment 17 Nicolas Fella 2025-01-08 16:49:28 UTC
Git commit c7cdc4b564ed3f3b1d896f5f52a3feea107d9088 by Nicolas Fella.
Committed on 08/01/2025 at 16:05.
Pushed by nicolasfella into branch 'master'.

[KColorSchemeWatcher] Fix reading XDG preference

There's an inner variant here that we need to unpack

Amends 91c23a57f39103201d305480eb24039942a376ad

M  +1    -1    src/colors/kcolorschemewatcher_xdg.cpp

https://invent.kde.org/frameworks/kguiaddons/-/commit/c7cdc4b564ed3f3b1d896f5f52a3feea107d9088
Comment 18 Nicolas Fella 2025-01-08 16:50:33 UTC
Git commit 7c50ed34fe31ce0a8a0c12fd5f7fd368f94d9c47 by Nicolas Fella.
Committed on 08/01/2025 at 16:50.
Pushed by nicolasfella into branch 'Frameworks/6.10'.

[KColorSchemeWatcher] Fix reading XDG preference

There's an inner variant here that we need to unpack

Amends 91c23a57f39103201d305480eb24039942a376ad

M  +1    -1    src/colors/kcolorschemewatcher_xdg.cpp

https://invent.kde.org/frameworks/kguiaddons/-/commit/7c50ed34fe31ce0a8a0c12fd5f7fd368f94d9c47