ft.FilePicker does not work on some Linux distros like KDE
redromnon opened this issue · comments
Description
Looks to me like the FilePicker component works on GNOME (tested on Pop OS 22.04 and Ubuntu 24.04) and opens up the native folder application to select a folder. But it doesn't do anything on KDE Plasma 5 and 6 (Tested on Kubuntu 24.04 and Arch Linux).
Code example to reproduce the issue:
folder_picker = ft.FilePicker(on_result=folder_dialog_result)
select_folder_icon = ft.IconButton(
icon=ft.icons.FOLDER_ROUNDED, tooltip="Select folder location",
on_click=lambda e: folder_picker.get_directory_path()
)
def folder_dialog_result(self, e: ft.FilePickerResultEvent):
print(e.path)
page.add(folder_picker)
page.add(select_folder_icon)
Describe the results you received:
Nothing happens after I click the folder icon. Got this error in journalctl
when I clicked on the folder icon:
xdp-kde-settings: Namespace "org.gnome.desktop.interface" is not supported
Describe the results you expected:
The native folder app should open and allow me to select a folder.
Additional information you deem important (e.g. issue happens only occasionally):
None
Flet version (pip show flet
):
Version: 0.19.0
Operating system:
Kubuntu 24.04 LTS
Additional environment details:
KDE Plasma Version: 5.27.11
KDE Frameworks Version 5.115.0
Qt Version: 5.15.13
Graphics Platform: X11
This is not because of the distribution, in your case Kubuntu. Kubuntu, with default KDE installed, also has the possibility to install the Gnome libraries.
See this article, for example:
https://www.reddit.com/r/Ubuntu/comments/m8q1qz/how_do_i_get_gnome_on_kubuntu/
So basically, when you install gnome via "apt install gnome" or "sudo apt install gnome" according to your rights on the system, you will be able to run the application and use the file picker.
Thanks for responding.
Basically, Flet will only work with GNOME File Picker and not with any other DE File Picker?