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

Dark mode doesn't work #14

Closed
chrsrns opened this issue Sep 16, 2021 · 12 comments
Closed

Dark mode doesn't work #14

chrsrns opened this issue Sep 16, 2021 · 12 comments

Comments

@chrsrns
Copy link

chrsrns commented Sep 16, 2021

Even after restarting the machine, the application is still on the light theme.

@wwmm
Copy link
Collaborator

wwmm commented Sep 16, 2021

Even outside of flatpak dark mode may not work depending on the themes you have installed. Sometime ago a user having this problem on KDE fixed it by installing a dark theme that could be used by gtk4. But I do not remember now exactly what he installed.

The dark mode isn't provided by EasyEffects. We just ask gtk to use one that is available and it does all the work.

@vchernin
Copy link
Collaborator

Furthermore see wwmm/easyeffects#1106

@akkisagiraju
Copy link

akkisagiraju commented Sep 19, 2021

Dark theme is not working on Flatpak version. Adding the test results from wwmm/easyeffects#1158 here:

Global Theme Application Style (GTK/GNOME style) Dark theme in EasyEffects Flatpak Dark theme in EasyEffects OpenSuse
Breeze Dark Breeze Not working Working
Breeze Dark Adwaita Dark Not working Working
Adwaita Dark Adwaita Dark Not working Working

Distro: openSUSE Tumbleweed
DE: KDE Plasma 5.22.5
EasyEffects Flatpak version: 6.1.1
EasyEffects OpenSuse version: 6.1.0

@vchernin
Copy link
Collaborator

I find this strange how unreliable it is. I still can't figure out why I can get dark theme working on KDE but others can't.

Regardless the actual fix seems to be integrating with the upcoming freedesktop dark mode preference, which is now implemented in the usual portal. But for EasyEffects to take advantage of that currently we'd need libadwaita or a similar library. @wwmm does that sound like something interesting to you? libadwaita is still quite new and won't fully be released before GNOME 42, so it might be something best to wait on.

@wwmm
Copy link
Collaborator

wwmm commented Sep 23, 2021

does that sound like something interesting to you? libadwaita is still quite new and won't fully be released before GNOME 42, so it might be something best to wait on.

People suggested it to me in the past. The main problem is that we use gtkmm to interact with gtk. And libadwaita is a C library probably designed for direct use in gtk and not gtkmm. It may work but I doubt it will be a plug and play process. And it is also not clear if it will keep working as updates to gtkmm and libadwaita are made.

@vchernin
Copy link
Collaborator

vchernin commented Sep 24, 2021

I found another GTK4 C++ app, they seem to use gtkmm as well as libadwaita.

I asked in the libadwaita matrix room, indeed no proper libadwaita bindings exist for C++ yet and gtkmm can't help with libadwaita. Though other than using the C API one could also use D-bus manually. There might be a blog post about that so maybe that'll help.

At least right now since libadwaita is in an alpha state I don't think much is guaranteed across versions. But when it's properly released it should be more reasonable to depend on.

@wwmm
Copy link
Collaborator

wwmm commented Sep 24, 2021

I see. Gtkmm allows access to the gtk object that is being wrapped. But from this point on you are writing C code. And as much as I like the end result gtk is able to provide programming GTK in C is really painful...

@vchernin
Copy link
Collaborator

vchernin commented Oct 4, 2021

See https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

Also this snippet for SDL: https://gist.github.com/BrainBlasted/931b763fc3dcdec2fc55a4ef64fca1ba

Not sure how easy it is to implement support for dark mode preference in GTK4 without libadwaita. Although keep in mind this feature will only really be useful (i.e. implemented in GNOME Shell/Settings) next year when GNOME 42 releases.

@wwmm
Copy link
Collaborator

wwmm commented Oct 4, 2021

Not sure how easy it is to implement support for dark mode preference in GTK4 without libadwaita.

The site says to use DBUS. What is probably painful... Let's wait and see what happens. At this moment the code we use for that requires only one line and no additional dependency. But does not work in Flatpak...

@vchernin
Copy link
Collaborator

vchernin commented Oct 4, 2021

But does not work in Flatpak...

The built in "Use Dark Theme" toggle already works for me in Flatpak on GNOME. And seems to also work at least for me on KDE on Fedora 35.

Not sure why it doesn't work for some users. There is some variable with KDE theming that we're missing.

@vchernin
Copy link
Collaborator

vchernin commented Dec 10, 2021

@LifeWatcher123 @akkisagiraju there is a flathub-beta branch available now, updated nightly. It should better support dark mode, and in the future KDE's settings app should be able to set it through the portal more reliably than before. I believe KDE already landed at least part of that change in xdg-desktop-portal-kde, but there might still be more.

You can test it here: https://github.com/wwmm/easyeffects/wiki/Package-Repositories#nightly-flatpak

@vchernin
Copy link
Collaborator

vchernin commented Jan 5, 2022

libadwaita build with color scheme portal is released now, see the wiki.

If you have questions or problems feel free to reopen this.

@vchernin vchernin closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants