1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
From b634b65dd081746ccb8bdfa9bf2d878d13e2c0fb Mon Sep 17 00:00:00 2001
From: Alexander Lohnau <alexander.lohnau@gmx.de>
Date: Tue, 24 May 2022 12:58:54 +0200
Subject: [PATCH] Fix QtQuickDialogWrapper dialog not being usable in konsole
Patch provided by David Edmundson.
```
Issue is QGuiApplicationPrivate::showModalWindow
it marks every other non-modal window as blocked, including new windows.
when we focus the new dialog at a wayland/X level Qt gets it, but in it's own internal dispatching ignores that and sends it to the modal window
Qt is smart enough to handle child windows appropriately, but only if it knows about them. Having a transient parent should take care of this. We should have this anyway as that will fix some window placement bugs.
```
BUG: 452593
---
src/qtquickdialogwrapper.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qtquickdialogwrapper.cpp b/src/qtquickdialogwrapper.cpp
index 4f22b650..e31e8d80 100644
--- a/src/qtquickdialogwrapper.cpp
+++ b/src/qtquickdialogwrapper.cpp
@@ -7,10 +7,12 @@
#include "qtquickdialogwrapper.h"
#include <QEventLoop>
+#include <QGuiApplication>
#include <QQmlComponent>
#include <QQmlContext>
#include <QQmlEngine>
#include <QTimer>
+#include <QWindow>
#include <KLocalizedContext>
@@ -70,6 +72,11 @@ QtQuickDialogWrapper::QtQuickDialogWrapper(const QString &configFile, QObject *p
// Forward relevant signals
connect(d->item, SIGNAL(closed()), this, SIGNAL(closed()));
+
+ // Otherwise, the dialog is not in front of other popups, BUG: 452593
+ auto window = qobject_cast<QWindow *>(d->item);
+ Q_ASSERT(window);
+ window->setTransientParent(QGuiApplication::focusWindow());
}
}
--
GitLab
|