OK, so I have tested a number of distros and, importantly, desktops. I observe -
- Using HasX11 (defined in QT defines) is not a useful indicator of the problem, every DE I tested had HasX11 set.
- Of the DEs I tested, we have a problem only with XFCe, Mate and Budgie.
- Gnome, Plasma, enlightenment, Cinnamon, LXDE, LXQT all work OK.
My data -
226 Fixes Hack Distro/DE
OK Bad OK Ubuntu 20.04 Mate X
OK Bad OK Ubuntu 23.04 XFCe X
OK OK Ubuntu 23.04 Gnome X, WD
OK OK Debian Bookworm Plasma X, WD
OK OK Debian Bookworm Cinnamon X
OK OK Debian Bookworm OpenBox X
OK OK Debian Bookworm LXDE X
OK OK Debian Bookworm LXQt X
OK Bad OK Debian Bullseye Mate X
OK Bad OK Fedora 37 Mate X
OK OK Fedora 38 Gnome X, WD
OK OK Debian Bookworm enlightenment X (dialog same)
OK Bad OK Debian Bookworm Budgie X
I made test binaries with Lazarus 2.2.6 (no changes) and a hacked Fixes_3_0 that allowed me to enable or disable the hack with an env variable. 'Bad' means the 20 second delay before showing the dialog. 'X' means that the QT5 code sees HasX11 set and 'WD' means the session has WAYLAND_DISPLAY var set to something.
In all cases, with the hack the result is usable but sometimes unnecessary. When its unnecessary but still applied we get the less than perfect default QT dialog.
So, using HasX11 as a trigger for the hack is inappropriate. Using WAYLAND_DISPLAY is a lot better but will still force some less popular DEs to use the default dialogs. Personally, I do not like the idea of coding tests for individual DEs but I suspect that is the only way to get a perfect result. It will leave us with code needing tweaking from time to time I expect (ie when a new desktop comes along).
On the other hand, just using WAYLAND_DISPLAY leaves everyone reasonably happy ....
I cannot attach the compiled binaries but if someone wants to try a test of their own, please let me know and I'll put them up on google drive or whatever ....
David