hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
262 stars 42 forks source link

QT Theme seems to be ignore even when `QT_QPA_PLATFORMTHEME` has value set #145

Closed mxaddict closed 8 months ago

mxaddict commented 8 months ago

I've set my environment variable QT_QPA_PLATFORMTHEME to gtk2 but the sharescreen and other qt apps seem to not honor the gtk theme set.

Some other apps like nautilus, audacity, gparted, kde-polkit also don't use the correct theme.

I've run the following:

gsettings set org.gnome.desktop.interface gtk-theme "Dracula"
gsettings set org.gnome.desktop.interface icon-theme "Dracula"
gsettings set org.gnome.desktop.interface color-scheme prefer-dark

NOTES: chromium, nemo and some other apps seem to be using the correct theme.

vaxerski commented 8 months ago

https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/#share-picker-doesnt-use-the-system-theme ?

mxaddict commented 8 months ago

https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/#share-picker-doesnt-use-the-system-theme ?

I've run both of those.

dbus-update-activation-environment --systemd --all
systemctl --user import-environment QT_QPA_PLATFORMTHEME
mxaddict commented 8 months ago

Additionally, I have these env values set:

env = CLUTTER_BACKEND,wayland
env = GDK_BACKEND,wayland,x11
env = GTK_THEME,Dracula
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_QPA_PLATFORMTHEME,gtk2
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
mxaddict commented 8 months ago

Also for nautilus when I run it from terminal as GTK_THEME=Dracula nautilus it seems to pickup the theme, but I have that env set in my hyprland.conf so I'm stumped 🤣

I must have burked my config somewhere 🤷🏼

mxaddict commented 8 months ago

Ok, so for some reason after I installed xdg-desktop-portal-gtk used that for a bit, then switched back to xdg-desktop-portal-hyprland it seems to now use the correct theme for screen share popup...

Not sure what to make of that.

GTK4 themed apps also now seem to use the dark mode but only if I keep xdg-desktop-portal-gtk installed even if not running? 🤷🏼

mxaddict commented 8 months ago

Ok, so for some reason after I installed xdg-desktop-portal-gtk used that for a bit, then switched back to xdg-desktop-portal-hyprland it seems to now use the correct theme for screen share popup...

Not sure what to make of that.

GTK4 themed apps also now seem to use the dark mode but only if I keep xdg-desktop-portal-gtk installed even if not running? 🤷🏼

Nvm, I was still running xdg-desktop-portal-gtk so it seems that GTK4 apps are not using correct theme settings when xdg-desktop-portal-hyprland is running, but work correctly if you use xdg-desktop-portal-gtk

But as for the QT apps, for some reason they are now working on bot (I guess I just had to restart xdg-desktop-portal)

vaxerski commented 8 months ago

image

https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/

xdph doesn't implement the preferred theme protocol either.

mxaddict commented 8 months ago

image

https://wiki.hyprland.org/Useful-Utilities/Hyprland-desktop-portal/

xdph doesn't implement the preferred theme protocol either.

I see, what are the features implemented in xdg-desktop-portal-hyprland that are not in xdg-desktop-portal-gtk ?

Would it make sense to switch to xdg-desktop-portal-gtk and not have xdg-desktop-portal-hyprland running at all?

vaxerski commented 8 months ago

no. gtk only implements gtk stuff. a file picker, color theme, etc.

hyprland implements screensharing, screencopy and global shortcuts.

mxaddict commented 8 months ago

no. gtk only implements gtk stuff. a file picker, color theme, etc.

hyprland implements screensharing, screencopy and global shortcuts.

I see, so optimally I would need both?

vaxerski commented 8 months ago

yes

mxaddict commented 8 months ago

Thanks for the help!

helixoid commented 6 months ago

Why not implement the important stuff from kde and gtk portal for consistency and not depending on running more than one xdg-desktop-portal implementation?

If not all, then at least the theming portals for qt and gtk apps.

Again, this is just a suggestion as I really love this project and want it to improve the integration of apps (especially flatpaks) in the desktop.

fufexan commented 6 months ago

The XDG Portal specification supports running multiple portals at the same time, and using only specific interfaces from each of those. It is way easier to rely on what's already built and working, and not rewrite everything from scratch.

helixoid commented 6 months ago

The XDG Portal specification supports running multiple portals at the same time

But when I first installed Hyprland and ran it, it was complaining about more than one xdg-desktop-portal interfaces then I had to manually uninstall xdgp-kde and xdgp-gnome to only run xdgp-hyprland at least it did when it was Hyprland v0.30 or something then I added paru -Rns xdg-desktop-portal-kde xdg-desktop-portal-gnome in my install script.

fufexan commented 6 months ago

Yes, that's how it was a while ago. Since a few months ago, the portal specification allows multiple portals to coexist, and only needed ones to be started for a given environment. For Hyprland, those are the gtk and hyprland portals. That's why the warning was removed from Hyprland.

helixoid commented 6 months ago

Yes, that's how it was a while ago. Since a few months ago, the portal specification allows multiple portals to coexist, and only needed ones to be started for a given environment. For Hyprland, those are the gtk and hyprland portals. That's why the warning was removed from Hyprland.

Got it!