FedoraQt/QGnomePlatform

Question: Does the file dialog property open in dark mode?

Closed this issue · 7 comments

Thank you for making this available. It is the only way to get things to look decently well for Qt Application on wayland that I've found.

I'm working to package this on conda(-forge).

conda allows users to install software in a directory of their choice.

I've hit the usual conda bug where things that don't live in the system directories break:
conda-forge/qt-main-feedstock#177
conda-forge/qgnomeplatform-feedstock#5

I'm able to get the "qt application" to take on the "dark / light" themes from the gnome plugin you created, however once I open a file dialog, they always seem to be opened with the Adwaita light theme.

Is this a known bug here? or is the bug likely in the conda integration.

Thank you for your input.

I'm using version 0.9.1, ubuntu 23.04

grulja commented

The file dialog is either opened using Gtk or using xdg-desktop-portal. In both cases it should be Gtk (xdg-desktop-portal-gtk) who is responsible for theming, we just modify Qt stuff. Do other Gtk apps open in dark style?

Thank you for your reply. It seems that the likely cause is a misconfiguration of conda.

Gtk or using xdg-desktop-portal

Can you point me to where I can add a print statement to confirm the code path?

Do other Gtk apps open in dark style?

If I uninstall your plugin, and install the gtk-platformtheme from Qt, that file dialog opens with the correct theme.

Thanks again for the input and the help.

A little more information on "do other gtk application get themed correctly":

I created a demo application following:
https://python-gtk-3-tutorial.readthedocs.io/en/latest/dialogs.html

gi

gi_demo.py.txt

image

qt

qt_demo.py.txt

image

I think I finally found that the code here that gets run is from:

https://github.com/FedoraQt/QGnomePlatform/blob/master/src/theme/qxdgdesktopportalfiledialog.cpp#L163

(openPortal function call)

I used the example that somebody else on github created to open the file dialog through dbus + xdg desktop portal
flatpak/xdg-desktop-portal#820 (comment)

It seems to create the same "unthemed" window.

It seems that it has to do with the conda + xdg desktop portal + ubuntu integration.

I tested running things from the the ubuntu shipped python, and it seems that it is also unthemed. Maybe it is an issue with ubuntu's XDG desktop portal.

Ok i don't think there is anything to do with your code.

I've patched out XDG usage for now (thanks for making that easy) and I think this makes things "better" for my usecase.

I'll keep an eye periodicially and likely open an issue with ubuntu once I get back on an LTS.

FYI, my patch is
https://github.com/conda-forge/qgnomeplatform-feedstock/pull/7/files#diff-a014225d62fbfa18a53c3f8e70e9a9eae5aee55b4bd9411402668c2797380b55

grulja commented

I'm glad you managed to find a workaround. I'm closing this bug now as it's not related to QGnomePlatform.