File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -530,11 +530,15 @@ bool Region::check(const QVariant& val)
530530
531531QVariant Region::process (const QVariant& val)
532532{
533- // FIXME: This is temporary, just before D-Bus is removed
533+ // Create a temporary QApplication if there is no global Qt application
534+ // instance at all. Creating one while a QCoreApplication already exists
535+ // is forbidden by Qt: the second constructor aborts early, but its
536+ // destructor still runs and corrupts global state (e.g. Wayland
537+ // connections), causing subsequent portal calls to hang.
534538 auto argv = std::make_unique<char *[]>(1 );
535539 auto argc = std::make_unique<int >(0 );
536540 std::unique_ptr<QApplication> tempApp;
537- if (QGuiApplication::screens (). empty ()) {
541+ if (! QCoreApplication::instance ()) {
538542 tempApp = std::make_unique<QApplication>(*argc, argv.get ());
539543 }
540544
You can’t perform that action at this time.
0 commit comments