Bug 505746 - file chooser portal bad choices placement
Summary: file chooser portal bad choices placement
Status: RESOLVED FIXED
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.4.80
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-18 15:12 UTC by alanas.00
Modified: 2025-06-23 14:50 UTC (History)
3 users (show)

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


Attachments
screenshot real (296.81 KB, image/webp)
2025-06-18 15:12 UTC, alanas.00
Details
screehshot fake (299.93 KB, image/webp)
2025-06-18 15:20 UTC, alanas.00
Details
handbrake 1.9.2 flatpak checkboxes (363.89 KB, image/webp)
2025-06-18 15:42 UTC, alanas.00
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alanas.00 2025-06-18 15:12:18 UTC
Created attachment 182363 [details]
screenshot real

STEPS TO REPRODUCE
1. run
```
busctl call --user org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.FileChooser OpenFile \
'ssa{sv}' \
	'' \
	'badly designed file chooser' \
	1 \
		'choices' \
		'a(ssa(ss)s)' \
			1 \
				'my checkbox id' \
				'my checkbox name' \
				0 \
				'true'
```

OBSERVED RESULT
checkbox overlaps left side (look at screeenshot real.webp) and there is big region in top left corner where clicking doesn't work

EXPECTED RESULT
checkbox is below file type combo box (look at screeenshot fake.webp)

SOFTWARE/OS VERSIONS
KDE neon Unstable edition
KDE Plasma Version: 6.4.80
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.0
Comment 1 alanas.00 2025-06-18 15:20:09 UTC
Created attachment 182364 [details]
screehshot fake

this is patch (original https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/72e1eb28239bcf78f3ff6df2ca80d4b9e8f62b3a) makes checkbox be below file type combo box and clicking works everywhere:
```
diff --git a/src/filechooser.cpp b/src/filechooser.cpp
index 8b4ba602..1411bf36 100644
--- a/src/filechooser.cpp
+++ b/src/filechooser.cpp
@@ -482,7 +482,6 @@ void FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
 
     if (optionsWidget) {
         fileDialog->m_fileWidget->setCustomWidget({}, optionsWidget);
-        optionsWidget->setParent(fileDialog);
     }
 
     delayReply(message, fileDialog, this, [fileDialog, optionsWidget, checkboxes, comboboxes](int dialogResult) -> QVariantList {
```

why does `optionsWidget->setParent(fileDialog);` exist?
Comment 2 Nate Graham 2025-06-18 15:32:35 UTC
What's the use case for adding a checkbox in that manner ? I didn't even know that was possible!
Comment 3 alanas.00 2025-06-18 15:42:06 UTC
Created attachment 182365 [details]
handbrake 1.9.2 flatpak checkboxes

(In reply to Nate Graham from comment #2)
> What's the use case for adding a checkbox in that manner ?
handbrake 1.9.2 flatpak File → Open Directory...
Comment 4 Bug Janitor Service 2025-06-23 12:36:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/408
Comment 5 David Redondo 2025-06-23 14:41:44 UTC
Git commit a4b677e211fcc11bbf5a53fa895dd4a56adc668d by David Redondo.
Committed on 23/06/2025 at 14:36.
Pushed by davidre into branch 'master'.

filechooser: Do not parent the optionswidget

KFileWidget does already reparent the widget and it breaks the layout
FIXED-IN:6.4.1

M  +0    -2    src/filechooser.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/a4b677e211fcc11bbf5a53fa895dd4a56adc668d
Comment 6 David Redondo 2025-06-23 14:50:44 UTC
Git commit 6bfd36b7f4884fff7da82795581caeabd98fb070 by David Redondo.
Committed on 23/06/2025 at 14:45.
Pushed by davidre into branch 'Plasma/6.4'.

filechooser: Do not parent the optionswidget

KFileWidget does already reparent the widget and it breaks the layout
FIXED-IN:6.4.1


(cherry picked from commit a4b677e211fcc11bbf5a53fa895dd4a56adc668d)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +0    -2    src/filechooser.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/6bfd36b7f4884fff7da82795581caeabd98fb070