summaryrefslogtreecommitdiffstats
path: root/src/window-lib
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2022-03-01 17:41:36 +0100
committerRobert Griebl <robert.griebl@qt.io>2022-03-02 11:09:05 +0100
commit9429d8e84649a4c0a262c16a2eaf394dcc90c79b (patch)
tree9d68e93d94bc5491e6b10da104eee33dc9b4eb66 /src/window-lib
parented404c4fdb7d1c74dca554dc9ae4d5d0903c9bc2 (diff)
Create extra sockets only just before the Wayland compositor is created
Otherwise there will be a window where the socket already exists in file system, but is not adopted by the compositor yet, leading to "connection refused" errors should a client try to connect. Change-Id: Ic96c51c7e8175ab5e9ac40fc70b5f8dc97c11b71 Pick-to: 5.15 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Diffstat (limited to 'src/window-lib')
-rw-r--r--src/window-lib/windowmanager.cpp3
-rw-r--r--src/window-lib/windowmanager.h16
2 files changed, 17 insertions, 2 deletions
diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp
index b94591ae..81ee8412 100644
--- a/src/window-lib/windowmanager.cpp
+++ b/src/window-lib/windowmanager.cpp
@@ -677,6 +677,9 @@ void WindowManager::registerCompositorView(QQuickWindow *view)
#if defined(AM_MULTI_PROCESS)
if (!ApplicationManager::instance()->isSingleProcess()) {
if (!d->waylandCompositor) {
+ // this will trigger the creation of extra sockets in main.cpp
+ emit internalSignals.compositorAboutToBeCreated();
+
d->waylandCompositor = new WaylandCompositor(view, d->waylandSocketName);
for (const auto &extraSocket : d->extraWaylandSockets)
d->waylandCompositor->addSocketDescriptor(extraSocket);
diff --git a/src/window-lib/windowmanager.h b/src/window-lib/windowmanager.h
index 57a13966..16cc80ae 100644
--- a/src/window-lib/windowmanager.h
+++ b/src/window-lib/windowmanager.h
@@ -57,6 +57,17 @@ class Application;
class AbstractRuntime;
class WaylandCompositor;
+
+// A place to collect signals used internally by appman without polluting
+// WindowManager's public QML API.
+class WindowManagerInternalSignals : public QObject
+{
+ Q_OBJECT
+signals:
+ // Emitted right before the WaylandCompositor instance is created
+ void compositorAboutToBeCreated();
+};
+
class WindowManager : public QAbstractListModel
{
Q_OBJECT
@@ -95,6 +106,9 @@ public:
Q_INVOKABLE int indexOfWindow(QT_PREPEND_NAMESPACE_AM(Window) *window) const;
Q_INVOKABLE QObject *addExtension(QQmlComponent *component) const;
+ WindowManagerInternalSignals internalSignals;
+
+protected:
bool eventFilter(QObject *watched, QEvent *event) override;
signals:
@@ -113,8 +127,6 @@ signals:
void slowAnimationsChanged(bool);
- void _inProcessSurfaceItemReleased(QSharedPointer<QT_PREPEND_NAMESPACE_AM(InProcessSurfaceItem)>);
-
private slots:
void inProcessSurfaceItemCreated(QSharedPointer<QT_PREPEND_NAMESPACE_AM(InProcessSurfaceItem)> surfaceItem);
void setupWindow(QT_PREPEND_NAMESPACE_AM(Window) *window);