From e723b954a469767c29d6ff5b6fa8681ad1ae463d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Oct 2016 14:02:44 +0200 Subject: [PATCH 1/5] fix namespaced build. *again* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3cbc3efdac61a9f329d0796c64885e6565bd0b77 Reviewed-by: Giulio Camuffo Reviewed-by: Jędrzej Nowacki --- src/plugins/platforms/wayland/global/qwaylandclientextension.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/wayland/global/qwaylandclientextension.h b/src/plugins/platforms/wayland/global/qwaylandclientextension.h index afb3f868fba..3d80baaa1ac 100644 --- a/src/plugins/platforms/wayland/global/qwaylandclientextension.h +++ b/src/plugins/platforms/wayland/global/qwaylandclientextension.h @@ -40,6 +40,7 @@ #include #include +struct wl_interface; struct wl_registry; QT_BEGIN_NAMESPACE From cd36be21314471200f021474b1d00848541dd11e Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Mon, 10 Oct 2016 17:52:15 +0200 Subject: [PATCH 2/5] Client: Remove windows from keyboard focus list when destroyed This fixes the undefined behavior in tst_WaylandClient::touchDrag and mouseDrag Note: The test still fails if run twice in a row, but it appears to be deterministic. Task-number: QTBUG-56187 Change-Id: Ib45d82224f004d1324f2ce4d6b7df05ee36c04f5 Reviewed-by: Paul Olav Tvete (cherry picked from commit a33cc547055eb12c5efa82a6612cbf8793988b72) Reviewed-by: Johan Helsing --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 6 ++++++ src/plugins/platforms/wayland/qwaylanddisplay_p.h | 3 ++- src/plugins/platforms/wayland/qwaylandwindow.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index a5e61e28a73..6e167f3030f 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -421,6 +421,12 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic mLastKeyboardFocus = keyboardFocus; } +void QWaylandDisplay::handleWindowDestroyed(QWaylandWindow *window) +{ + if (mActiveWindows.contains(window)) + handleWindowDeactivated(window); +} + void QWaylandDisplay::handleWaylandSync() { // This callback is used to set the window activation because we may get an activate/deactivate diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index f4fb3fa56a8..2864b357d80 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -176,6 +176,7 @@ public: void handleWindowActivated(QWaylandWindow *window); void handleWindowDeactivated(QWaylandWindow *window); void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice); + void handleWindowDestroyed(QWaylandWindow *window); public slots: void blockingReadEvents(); @@ -217,7 +218,7 @@ private: uint32_t mLastInputSerial; QWaylandInputDevice *mLastInputDevice; QPointer mLastInputWindow; - QWaylandWindow *mLastKeyboardFocus; + QPointer mLastKeyboardFocus; QVector mActiveWindows; struct wl_callback *mSyncCallback; static const wl_callback_listener syncCallbackListener; diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index eb9c1409415..7256451911f 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -102,6 +102,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window) QWaylandWindow::~QWaylandWindow() { + mDisplay->handleWindowDestroyed(this); + delete mWindowDecoration; if (isInitialized()) From d14378ec1cc0f4a3e91850acf62621eca1ff6273 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 23 Nov 2016 14:01:41 +0100 Subject: [PATCH 3/5] Fix crash when destroying focus window Make sure we don't try to disable input for a window that has already been destroyed. Change-Id: I1224599b3c43e2315b3571f01c5896a001614dc4 Reviewed-by: Johan Helsing Reviewed-by: Jan Arne Petersen --- src/plugins/platforms/wayland/qwaylandinputcontext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp index 5a58d6d7509..dcc4ad5c7a0 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext.cpp +++ b/src/plugins/platforms/wayland/qwaylandinputcontext.cpp @@ -532,7 +532,8 @@ void QWaylandInputContext::setFocusObject(QObject *) if (mCurrentWindow && mCurrentWindow->handle()) { if (mCurrentWindow.data() != window || !inputMethodAccepted()) { struct ::wl_surface *surface = static_cast(mCurrentWindow->handle())->object(); - textInput()->disable(surface); + if (surface) + textInput()->disable(surface); mCurrentWindow.clear(); } } From 7a116ac3f02dc91ea2424d03facaa6a9f06310ae Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Thu, 24 Nov 2016 13:50:19 +0100 Subject: [PATCH 4/5] Don't crash when trying to run on a compositor without outputs Change-Id: I164ad71f42dff1ad92576729040608016497a56a Reviewed-by: Jan Arne Petersen Reviewed-by: Giulio Camuffo --- src/plugins/platforms/wayland/qwaylandintegration.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 748f4f29c8d..78d4284bd9a 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -216,6 +216,11 @@ void QWaylandIntegration::initialize() int fd = wl_display_get_fd(mDisplay->wl_display()); QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data()); QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests())); + + if (mDisplay->screens().isEmpty()) { + qWarning() << "Running on a compositor with no screens is not supported"; + ::exit(EXIT_FAILURE); + } } QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const From c6acb1256b5751484078f1112d684e200d4de7b1 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 2 Dec 2016 16:53:15 +0100 Subject: [PATCH 5/5] Doc: Mention files for different wayland protocols MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If7de71930a8339ff8b36e74331810b186e1ebd32 Reviewed-by: Topi Reiniö --- src/3rdparty/wayland/protocols/qt_attribution.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/3rdparty/wayland/protocols/qt_attribution.json b/src/3rdparty/wayland/protocols/qt_attribution.json index 327c408b961..76fd33d37f9 100644 --- a/src/3rdparty/wayland/protocols/qt_attribution.json +++ b/src/3rdparty/wayland/protocols/qt_attribution.json @@ -4,6 +4,7 @@ "Name": "Wayland Protocol", "QDocModule": "qtwaylandcompositor", "QtUsage": "Used in the Qt Wayland Compositor, and the Qt Wayland platform plugin.", + "Files": "wayland.xml", "Description": "Wayland is a protocol for a compositor to talk to its clients.", "Homepage": "https://wayland.freedesktop.org", @@ -22,6 +23,7 @@ "Name": "Wayland IVI Extension Protocol", "QDocModule": "qtwaylandcompositor", "QtUsage": "Used in the Qt Wayland Compositor, and the Qt Wayland platform plugin.", + "Files": "ivi-controller.xml ivi-application.xml", "Description": "\"Wayland IVI Extension\" is forked from IVI Layer Management to define a common set of APIs by wayland style protocol and provide reference implementation which can be loaded on Weston.", "Homepage": "http://projects.genivi.org/wayland-ivi-extension", @@ -39,6 +41,7 @@ Copyright (c) 2013 BMW Car IT GmbH" "Name": "Wayland XDG Shell Protocol", "QDocModule": "qtwaylandcompositor", "QtUsage": "Used in the Qt Wayland Compositor, and the Qt Wayland platform plugin.", + "Files": "xdg-shell.xml", "Description": "The XDG-Shell protocol is an extended way to manage surfaces under Wayland compositors.", "Homepage": "https://wayland.freedesktop.org", @@ -58,6 +61,7 @@ Copyright © 2010-2013 Intel Corporation" "Name": "Wayland Text Input Protocol", "QDocModule": "qtwaylandcompositor", "QtUsage": "Used in the Qt Wayland Compositor, and the Qt Wayland platform plugin.", + "Files": "text-input-unstable-v2.xml", "Description": "Adds support for text input and input methods to applications.", "Homepage": "https://wayland.freedesktop.org",