summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-03 12:10:54 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-03 12:11:41 +0100
commit0e5b26942c9ff8b85322a63f577bd7a91ff0851a (patch)
tree01cbc798c813546af32e6d6de2cae923b23ba2d5
parentd62667f43dcd535d9315394c4ffb2faec44684fe (diff)
parente05f6c01d2ac4b807c07a682927f75d70292595b (diff)
Merge remote-tracking branch 'origin/5.8' into dev
-rw-r--r--examples/wayland/multi-screen/main.cpp55
-rw-r--r--examples/wayland/multi-screen/multi-screen.pro18
-rw-r--r--examples/wayland/multi-screen/multi-screen.qrc7
-rw-r--r--examples/wayland/multi-screen/qml/Chrome.qml77
-rw-r--r--examples/wayland/multi-screen/qml/Screen.qml82
-rw-r--r--examples/wayland/multi-screen/qml/main.qml127
-rw-r--r--examples/wayland/wayland.pro1
-rw-r--r--src/client/client.pro9
-rw-r--r--src/client/qwaylanddatadevice.cpp3
-rw-r--r--src/client/qwaylanddatadevice_p.h3
-rw-r--r--src/client/qwaylanddisplay.cpp6
-rw-r--r--src/client/qwaylanddisplay_p.h3
-rw-r--r--src/client/qwaylandintegration.cpp71
-rw-r--r--src/client/qwaylandintegration_p.h22
-rw-r--r--src/client/qwaylandwindow.cpp2
-rw-r--r--src/client/qwaylandwindowmanagerintegration_p.h2
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.cpp7
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem_p.h2
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp2
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp2
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h2
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp2
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp2
-rw-r--r--src/hardwareintegration/client/wayland-egl/wayland-egl.pri2
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp2
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp2
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h2
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp4
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri2
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h2
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri2
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri1
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp2
-rw-r--r--src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro2
-rw-r--r--tests/auto/client/client/mockcompositor.cpp6
-rw-r--r--tests/auto/client/client/mockinput.cpp16
-rw-r--r--tests/auto/client/client/mockinput.h2
37 files changed, 475 insertions, 79 deletions
diff --git a/examples/wayland/multi-screen/main.cpp b/examples/wayland/multi-screen/main.cpp
new file mode 100644
index 000000000..81adbc13d
--- /dev/null
+++ b/examples/wayland/multi-screen/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtCore/QUrl>
+#include <QtCore/QDebug>
+
+#include <QtGui/QGuiApplication>
+
+#include <QtQml/QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine appEngine(QUrl("qrc:///qml/main.qml"));
+
+ return app.exec();
+}
diff --git a/examples/wayland/multi-screen/multi-screen.pro b/examples/wayland/multi-screen/multi-screen.pro
new file mode 100644
index 000000000..29e1479da
--- /dev/null
+++ b/examples/wayland/multi-screen/multi-screen.pro
@@ -0,0 +1,18 @@
+QT += gui qml
+
+SOURCES += \
+ main.cpp
+
+OTHER_FILES = \
+ qml/main.qml \
+
+RESOURCES += multi-screen.qrc
+
+target.path = $$[QT_INSTALL_EXAMPLES]/wayland/multi-screen
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS multi-screen.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/wayland/multi-screen
+INSTALLS += target sources
+
+DISTFILES += \
+ qml/Screen.qml \
+ qml/Chrome.qml
diff --git a/examples/wayland/multi-screen/multi-screen.qrc b/examples/wayland/multi-screen/multi-screen.qrc
new file mode 100644
index 000000000..57fcd3cf6
--- /dev/null
+++ b/examples/wayland/multi-screen/multi-screen.qrc
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/">
+ <file>qml/main.qml</file>
+ <file>qml/Screen.qml</file>
+ <file>qml/Chrome.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/wayland/multi-screen/qml/Chrome.qml b/examples/wayland/multi-screen/qml/Chrome.qml
new file mode 100644
index 000000000..d91a93043
--- /dev/null
+++ b/examples/wayland/multi-screen/qml/Chrome.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtWayland.Compositor 1.0
+
+Item {
+ id: chrome
+ property alias shellSurface: surfaceItem.shellSurface
+ property alias surfaceItem: surfaceItem
+ property alias moveItem: surfaceItem.moveItem
+
+ x: surfaceItem.moveItem.x - surfaceItem.output.geometry.x
+ y: surfaceItem.moveItem.y - surfaceItem.output.geometry.y
+
+ ShellSurfaceItem {
+ id: surfaceItem
+ onSurfaceDestroyed: chrome.destroy();
+ }
+
+ onXChanged: updatePrimary()
+ onYChanged: updatePrimary()
+ function updatePrimary() {
+ var w = surfaceItem.width
+ var h = surfaceItem.height
+ var area = w * h;
+ var screenW = surfaceItem.output.geometry.width;
+ var screenH = surfaceItem.output.geometry.height;
+ var x1 = Math.max(0, x);
+ var y1 = Math.max(0, y);
+ var x2 = Math.min(x + w, screenW);
+ var y2 = Math.min(y + h, screenH);
+ var w1 = Math.max(0, x2 - x1);
+ var h1 = Math.max(0, y2 - y1);
+ if (w1 * h1 * 2 > area) {
+ surfaceItem.setPrimary();
+ }
+ }
+}
diff --git a/examples/wayland/multi-screen/qml/Screen.qml b/examples/wayland/multi-screen/qml/Screen.qml
new file mode 100644
index 000000000..7e2eb01dc
--- /dev/null
+++ b/examples/wayland/multi-screen/qml/Screen.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtWayland.Compositor 1.0
+import QtQuick.Window 2.2
+
+WaylandOutput {
+ id: screen
+ property variant viewsBySurface: ({})
+ property alias surfaceArea: background
+ property alias text: t.text
+ sizeFollowsWindow: true
+
+ window: Window {
+ width: 1024
+ height: 760
+ visible: true
+
+ WaylandMouseTracker {
+ id: mouseTracker
+ anchors.fill: parent
+ windowSystemCursorEnabled: false
+
+ Rectangle {
+ anchors.fill: parent
+ id: background
+
+ Text {
+ id: t
+ anchors.centerIn: parent
+ font.pointSize: 72
+ }
+ }
+
+ WaylandCursorItem {
+ inputEventsEnabled: false
+ x: mouseTracker.mouseX
+ y: mouseTracker.mouseY
+ seat: comp.defaultSeat
+ visible: mouseTracker.containsMouse
+ }
+ }
+ }
+}
diff --git a/examples/wayland/multi-screen/qml/main.qml b/examples/wayland/multi-screen/qml/main.qml
new file mode 100644
index 000000000..37350289e
--- /dev/null
+++ b/examples/wayland/multi-screen/qml/main.qml
@@ -0,0 +1,127 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtWayland.Compositor 1.0
+
+WaylandCompositor {
+ id: comp
+ defaultOutput: middleScreen
+
+ Screen {
+ id: leftScreen
+ position.x: -leftScreen.surfaceArea.width
+ position.y: 0
+ surfaceArea.color: "#f00"
+ text: "Left"
+ compositor: comp
+ }
+
+ Screen {
+ id: middleScreen
+ position.x: leftScreen.position.x + leftScreen.surfaceArea.width
+ position.y: 0
+ text: "Middle"
+ surfaceArea.color: "#0f0"
+ compositor: comp
+ }
+
+ Screen {
+ id: rightScreen
+ position.x: middleScreen.position.x + middleScreen.surfaceArea.width
+ position.y: 0
+ surfaceArea.color: "#00f"
+ text: "Right"
+ compositor: comp
+ }
+
+ Component {
+ id: chromeComponent
+ Chrome {}
+ }
+
+ Component {
+ id: moveItemComponent
+ Item {}
+ }
+
+ Item {
+ id: rootItem
+ x: leftScreen.position.x
+ y: leftScreen.position.y
+ width: leftScreen.surfaceArea.width + middleScreen.surfaceArea.width + rightScreen.surfaceArea.width
+ height: Math.max(leftScreen.surfaceArea.height, middleScreen.surfaceArea.height, rightScreen.surfaceArea.height)
+ }
+
+ WlShell {
+ onWlShellSurfaceCreated: handleShellSurfaceCreated(shellSurface)
+ }
+
+ XdgShellV5 {
+ onXdgSurfaceCreated: handleShellSurfaceCreated(xdgSurface)
+ onXdgPopupCreated: handleShellSurfaceCreated(xdgPopup)
+ }
+
+ function createShellSurfaceItem(shellSurface, moveItem, output) {
+ var parentSurfaceItem = output.viewsBySurface[shellSurface.parentSurface];
+ var parent = parentSurfaceItem || output.surfaceArea;
+ var item = chromeComponent.createObject(parent, {
+ "shellSurface": shellSurface,
+ "moveItem": moveItem,
+ "output": output
+ });
+ if (parentSurfaceItem) {
+ item.x += output.position.x;
+ item.y += output.position.y;
+ }
+ output.viewsBySurface[shellSurface.surface] = item;
+ }
+
+ function handleShellSurfaceCreated(shellSurface) {
+ var moveItem = moveItemComponent.createObject(rootItem, {
+ "width": Qt.binding(function() { return shellSurface.surface.width; }),
+ "height": Qt.binding(function() { return shellSurface.surface.height; })
+ });
+ createShellSurfaceItem(shellSurface, moveItem, middleScreen);
+ createShellSurfaceItem(shellSurface, moveItem, leftScreen);
+ createShellSurfaceItem(shellSurface, moveItem, rightScreen);
+ }
+}
diff --git a/examples/wayland/wayland.pro b/examples/wayland/wayland.pro
index f36bf69e8..2a5395004 100644
--- a/examples/wayland/wayland.pro
+++ b/examples/wayland/wayland.pro
@@ -10,6 +10,7 @@ contains(QT_CONFIG, opengl):qtHaveModule(quick) {
SUBDIRS += spanning-screens
SUBDIRS += pure-qml
SUBDIRS += multi-output
+ SUBDIRS += multi-screen
SUBDIRS += custom-extension
SUBDIRS += server-buffer
SUBDIRS += ivi-compositor
diff --git a/src/client/client.pro b/src/client/client.pro
index fa2036745..34955dfbb 100644
--- a/src/client/client.pro
+++ b/src/client/client.pro
@@ -2,13 +2,18 @@ TARGET = QtWaylandClient
MODULE = waylandclient
QT += core-private gui-private
-QT_FOR_PRIVATE += platformsupport-private
+QT_FOR_PRIVATE += service_support-private
+QT_PRIVATE += fontdatabase_support-private eventdispatcher_support-private theme_support-private
# We have a bunch of C code with casts, so we can't have this option
QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
+# Prevent gold linker from crashing.
+# This started happening when QtPlatformSupport was modularized.
+use_gold_linker: CONFIG += no_linker_version_script
+
CONFIG -= precompile_header
-CONFIG += link_pkgconfig qpa/genericunixfontdatabase wayland-scanner
+CONFIG += link_pkgconfig wayland-scanner
contains(QT_CONFIG, opengl) {
DEFINES += QT_WAYLAND_GL_SUPPORT
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp
index 0ff1f1979..d04c20bf4 100644
--- a/src/client/qwaylanddatadevice.cpp
+++ b/src/client/qwaylanddatadevice.cpp
@@ -183,7 +183,8 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface,
void QWaylandDataDevice::data_device_leave()
{
- QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction);
+ if (m_dragWindow)
+ QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction);
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
if (!drag) {
diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h
index 579cb3c7c..7daa9f0d3 100644
--- a/src/client/qwaylanddatadevice_p.h
+++ b/src/client/qwaylanddatadevice_p.h
@@ -53,6 +53,7 @@
//
#include <QObject>
+#include <QPointer>
#include <QPoint>
#include <QtWaylandClient/private/qwayland-wayland.h>
@@ -106,7 +107,7 @@ private:
QWaylandDisplay *m_display;
QWaylandInputDevice *m_inputDevice;
uint32_t m_enterSerial;
- QWindow *m_dragWindow;
+ QPointer<QWindow> m_dragWindow;
QPoint m_dragPoint;
QScopedPointer<QWaylandDataOffer> m_dragOffer;
QScopedPointer<QWaylandDataOffer> m_selectionOffer;
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index d94afcab5..3fd2aa565 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -422,6 +422,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/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index f4fb3fa56..2864b357d 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/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<QWaylandWindow> mLastInputWindow;
- QWaylandWindow *mLastKeyboardFocus;
+ QPointer<QWaylandWindow> mLastKeyboardFocus;
QVector<QWaylandWindow *> mActiveWindows;
struct wl_callback *mSyncCallback;
static const wl_callback_listener syncCallbackListener;
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index 0e9eb44d6..3e2630610 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -50,9 +50,9 @@
#include "qwaylandwindowmanagerintegration_p.h"
#include "qwaylandscreen_p.h"
-#include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h"
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
-#include <QtPlatformSupport/private/qgenericunixthemes_p.h>
+#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
+#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
+#include <QtThemeSupport/private/qgenericunixthemes_p.h>
#include <QtGui/private/qguiapplication_p.h>
@@ -119,7 +119,6 @@ public:
QWaylandIntegration::QWaylandIntegration()
: mClientBufferIntegration(0)
- , mShellIntegration(Q_NULLPTR)
, mInputDeviceIntegration(Q_NULLPTR)
, mFontDb(new QGenericUnixFontDatabase())
, mNativeInterface(new QWaylandNativeInterface(this))
@@ -131,16 +130,16 @@ QWaylandIntegration::QWaylandIntegration()
, mShellIntegrationInitialized(false)
{
initializeInputDeviceIntegration();
- mDisplay = new QWaylandDisplay(this);
- mClipboard = new QWaylandClipboard(mDisplay);
- mDrag = new QWaylandDrag(mDisplay);
+ mDisplay.reset(new QWaylandDisplay(this));
+ mClipboard.reset(new QWaylandClipboard(mDisplay.data()));
+ mDrag.reset(new QWaylandDrag(mDisplay.data()));
QString icStr = QPlatformInputContextFactory::requested();
if (!icStr.isNull()) {
mInputContext.reset(QPlatformInputContextFactory::create(icStr));
} else {
//try to use the input context using the wl_text_input interface
- QPlatformInputContext *ctx = new QWaylandInputContext(mDisplay);
+ QPlatformInputContext *ctx = new QWaylandInputContext(mDisplay.data());
mInputContext.reset(ctx);
//use the traditional way for on screen keyboards for now
@@ -153,18 +152,11 @@ QWaylandIntegration::QWaylandIntegration()
QWaylandIntegration::~QWaylandIntegration()
{
- delete mDrag;
- delete mClipboard;
-#ifndef QT_NO_ACCESSIBILITY
- delete mAccessibility;
-#endif
- delete mNativeInterface;
- delete mDisplay;
}
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
{
- return mNativeInterface;
+ return mNativeInterface.data();
}
bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) const
@@ -217,27 +209,27 @@ QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
void QWaylandIntegration::initialize()
{
QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
- QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay, SLOT(flushRequests()));
- QObject::connect(dispatcher, SIGNAL(awake()), mDisplay, SLOT(flushRequests()));
+ QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests()));
+ QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests()));
int fd = wl_display_get_fd(mDisplay->wl_display());
- QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay);
- QObject::connect(sn, SIGNAL(activated(int)), mDisplay, SLOT(flushRequests()));
+ QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data());
+ QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests()));
}
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
{
- return mFontDb;
+ return mFontDb.data();
}
QPlatformClipboard *QWaylandIntegration::clipboard() const
{
- return mClipboard;
+ return mClipboard.data();
}
QPlatformDrag *QWaylandIntegration::drag() const
{
- return mDrag;
+ return mDrag.data();
}
QPlatformInputContext *QWaylandIntegration::inputContext() const
@@ -263,7 +255,7 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const
#ifndef QT_NO_ACCESSIBILITY
QPlatformAccessibility *QWaylandIntegration::accessibility() const
{
- return mAccessibility;
+ return mAccessibility.data();
}
#endif
@@ -274,7 +266,7 @@ QPlatformServices *QWaylandIntegration::services() const
QWaylandDisplay *QWaylandIntegration::display() const
{
- return mDisplay;
+ return mDisplay.data();
}
QStringList QWaylandIntegration::themeNames() const
@@ -292,7 +284,7 @@ QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration()
if (!mClientBufferIntegrationInitialized)
const_cast<QWaylandIntegration *>(this)->initializeClientBufferIntegration();
- return mClientBufferIntegration && mClientBufferIntegration->isValid() ? mClientBufferIntegration : 0;
+ return mClientBufferIntegration && mClientBufferIntegration->isValid() ? mClientBufferIntegration.data() : nullptr;
}
QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration() const
@@ -300,7 +292,7 @@ QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration()
if (!mServerBufferIntegrationInitialized)
const_cast<QWaylandIntegration *>(this)->initializeServerBufferIntegration();
- return mServerBufferIntegration;
+ return mServerBufferIntegration.data();
}
QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
@@ -308,7 +300,7 @@ QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
if (!mShellIntegrationInitialized)
const_cast<QWaylandIntegration *>(this)->initializeShellIntegration();
- return mShellIntegration;
+ return mShellIntegration.data();
}
void QWaylandIntegration::initializeClientBufferIntegration()
@@ -334,10 +326,10 @@ void QWaylandIntegration::initializeClientBufferIntegration()
QStringList keys = QWaylandClientBufferIntegrationFactory::keys();
if (keys.contains(targetKey)) {
- mClientBufferIntegration = QWaylandClientBufferIntegrationFactory::create(targetKey, QStringList());
+ mClientBufferIntegration.reset(QWaylandClientBufferIntegrationFactory::create(targetKey, QStringList()));
}
if (mClientBufferIntegration)
- mClientBufferIntegration->initialize(mDisplay);
+ mClientBufferIntegration->initialize(mDisplay.data());
else
qWarning("Failed to load client buffer integration: %s\n", qPrintable(targetKey));
}
@@ -364,10 +356,10 @@ void QWaylandIntegration::initializeServerBufferIntegration()
QStringList keys = QWaylandServerBufferIntegrationFactory::keys();
if (keys.contains(targetKey)) {
- mServerBufferIntegration = QWaylandServerBufferIntegrationFactory::create(targetKey, QStringList());
+ mServerBufferIntegration.reset(QWaylandServerBufferIntegrationFactory::create(targetKey, QStringList()));
}
if (mServerBufferIntegration)
- mServerBufferIntegration->initialize(mDisplay);
+ mServerBufferIntegration->initialize(mDisplay.data());
else
qWarning("Failed to load server buffer integration %s\n", qPrintable(targetKey));
}
@@ -383,7 +375,7 @@ void QWaylandIntegration::initializeShellIntegration()
QStringList keys = QWaylandShellIntegrationFactory::keys();
if (keys.contains(targetKey)) {
qDebug("Using the '%s' shell integration", qPrintable(targetKey));
- mShellIntegration = QWaylandShellIntegrationFactory::create(targetKey, QStringList());
+ mShellIntegration.reset(QWaylandShellIntegrationFactory::create(targetKey, QStringList()));
}
} else {
QStringList preferredShells;
@@ -393,15 +385,14 @@ void QWaylandIntegration::initializeShellIntegration()
Q_FOREACH (QString preferredShell, preferredShells) {
if (mDisplay->hasRegistryGlobal(preferredShell)) {
- mShellIntegration = createShellIntegration(preferredShell);
+ mShellIntegration.reset(createShellIntegration(preferredShell));
break;
}
}
}
- if (!mShellIntegration || !mShellIntegration->initialize(mDisplay)) {
- delete mShellIntegration;
- mShellIntegration = Q_NULLPTR;
+ if (!mShellIntegration || !mShellIntegration->initialize(mDisplay.data())) {
+ mShellIntegration.reset();
qWarning("Failed to load shell integration %s", qPrintable(targetKey));
}
}
@@ -425,7 +416,7 @@ void QWaylandIntegration::initializeInputDeviceIntegration()
QStringList keys = QWaylandInputDeviceIntegrationFactory::keys();
if (keys.contains(targetKey)) {
- mInputDeviceIntegration = QWaylandInputDeviceIntegrationFactory::create(targetKey, QStringList());
+ mInputDeviceIntegration.reset(QWaylandInputDeviceIntegrationFactory::create(targetKey, QStringList()));
qDebug("Using the '%s' input device integration", qPrintable(targetKey));
} else {
qWarning("Wayland inputdevice integration '%s' not found, using default", qPrintable(targetKey));
@@ -435,9 +426,9 @@ void QWaylandIntegration::initializeInputDeviceIntegration()
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &interfaceName)
{
if (interfaceName == QLatin1Literal("wl_shell")) {
- return new QWaylandWlShellIntegration(mDisplay);
+ return new QWaylandWlShellIntegration(mDisplay.data());
} else if (interfaceName == QLatin1Literal("xdg_shell")) {
- return new QWaylandXdgShellIntegration(mDisplay);
+ return new QWaylandXdgShellIntegration(mDisplay.data());
} else {
return Q_NULLPTR;
}
diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h
index 9a4990229..bd66f55a7 100644
--- a/src/client/qwaylandintegration_p.h
+++ b/src/client/qwaylandintegration_p.h
@@ -54,6 +54,8 @@
#include <qpa/qplatformintegration.h>
#include <QtWaylandClient/qwaylandclientexport.h>
+#include <QtCore/QScopedPointer>
+
QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
@@ -113,10 +115,10 @@ public:
virtual QWaylandShellIntegration *shellIntegration() const;
protected:
- QWaylandClientBufferIntegration *mClientBufferIntegration;
- QWaylandServerBufferIntegration *mServerBufferIntegration;
- QWaylandShellIntegration *mShellIntegration;
- QWaylandInputDeviceIntegration *mInputDeviceIntegration;
+ QScopedPointer<QWaylandClientBufferIntegration> mClientBufferIntegration;
+ QScopedPointer<QWaylandServerBufferIntegration> mServerBufferIntegration;
+ QScopedPointer<QWaylandShellIntegration> mShellIntegration;
+ QScopedPointer<QWaylandInputDeviceIntegration> mInputDeviceIntegration;
private:
void initializeClientBufferIntegration();
@@ -125,14 +127,14 @@ private:
void initializeInputDeviceIntegration();
QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
- QPlatformFontDatabase *mFontDb;
- QPlatformClipboard *mClipboard;
- QPlatformDrag *mDrag;
- QWaylandDisplay *mDisplay;
- QPlatformNativeInterface *mNativeInterface;
+ QScopedPointer<QPlatformFontDatabase> mFontDb;
+ QScopedPointer<QPlatformClipboard> mClipboard;
+ QScopedPointer<QPlatformDrag> mDrag;
+ QScopedPointer<QWaylandDisplay> mDisplay;
+ QScopedPointer<QPlatformNativeInterface> mNativeInterface;
QScopedPointer<QPlatformInputContext> mInputContext;
#ifndef QT_NO_ACCESSIBILITY
- QPlatformAccessibility *mAccessibility;
+ QScopedPointer<QPlatformAccessibility> mAccessibility;
#endif
bool mClientBufferIntegrationInitialized;
bool mServerBufferIntegrationInitialized;
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 59c446bb3..2b7d81f88 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -102,6 +102,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
QWaylandWindow::~QWaylandWindow()
{
+ mDisplay->handleWindowDestroyed(this);
+
delete mWindowDecoration;
if (isInitialized())
diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h
index 0e5f67ac1..09a79d48d 100644
--- a/src/client/qwaylandwindowmanagerintegration_p.h
+++ b/src/client/qwaylandwindowmanagerintegration_p.h
@@ -55,7 +55,7 @@
#include <QtCore/QScopedPointer>
#include <wayland-client.h>
-#include <QtPlatformSupport/private/qgenericunixservices_p.h>
+#include <QtServiceSupport/private/qgenericunixservices_p.h>
#include <QtWaylandClient/private/qwayland-qt-windowmanager.h>
#include <QtWaylandClient/qwaylandclientexport.h>
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp
index f0454b72c..e6cfce343 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.cpp
+++ b/src/compositor/compositor_api/qwaylandquickitem.cpp
@@ -653,6 +653,9 @@ void QWaylandQuickItem::touchEvent(QTouchEvent *event)
seat->sendMouseMoveEvent(d->view.data(), pointPos, mapToScene(pointPos));
}
seat->sendFullTouchEvent(surface(), event);
+
+ if (event->type() == QEvent::TouchBegin && d->focusOnClick)
+ takeFocus(seat);
} else {
event->ignore();
}
@@ -921,7 +924,7 @@ void QWaylandQuickItem::updateSize()
* \qmlproperty bool QtWaylandCompositor::WaylandQuickItem::focusOnClick
*
* This property specifies whether the WaylandQuickItem should take focus when
- * it is clicked.
+ * it is clicked or touched.
*
* The default is \c true.
*/
@@ -930,7 +933,7 @@ void QWaylandQuickItem::updateSize()
* \property QWaylandQuickItem::focusOnClick
*
* This property specifies whether the QWaylandQuickItem should take focus when
- * it is clicked.
+ * it is clicked or touched.
*
* The default is \c true.
*/
diff --git a/src/compositor/compositor_api/qwaylandquickitem_p.h b/src/compositor/compositor_api/qwaylandquickitem_p.h
index c30829926..5eba99572 100644
--- a/src/compositor/compositor_api/qwaylandquickitem_p.h
+++ b/src/compositor/compositor_api/qwaylandquickitem_p.h
@@ -110,7 +110,7 @@ public:
, oldSurface(Q_NULLPTR)
, provider(Q_NULLPTR)
, paintEnabled(true)
- , touchEventsEnabled(false)
+ , touchEventsEnabled(true)
, inputEventsEnabled(true)
, isDragging(false)
, newTexture(false)
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
index fe7e17e86..4d56d66e6 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
@@ -43,7 +43,7 @@
#include <QtWaylandClient/private/qwaylandscreen_p.h>
#include "qwaylandbrcmglcontext.h"
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
index a14f6b024..f5480b0ed 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
@@ -43,7 +43,7 @@
#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandbrcmeglwindow.h"
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
index 024809ff6..233ce78bd 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
@@ -46,6 +46,6 @@
#include <wayland-egl.h>
#define EGL_EGLEXT_PROTOTYPES
-#include <QtPlatformSupport/private/qt_egl_p.h>
+#include <QtEglSupport/private/qt_egl_p.h>
#endif // QWAYLANDEGLINCLUDE_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index 417fc75bd..236218e7f 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -42,7 +42,7 @@
#include <QtWaylandClient/private/qwaylandscreen_p.h>
#include "qwaylandglcontext.h"
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QDebug>
#include <QtGui/QWindow>
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 72e7b0e6a..f70c75a33 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -47,7 +47,7 @@
#include "qwaylandeglwindow.h"
#include <QDebug>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtGui/private/qopenglcontext_p.h>
#include <QtGui/private/qopengltexturecache_p.h>
#include <QtGui/private/qguiapplication_p.h>
diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
index 520c1eb0f..276b7b54f 100644
--- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
+++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
@@ -8,7 +8,7 @@ INCLUDEPATH += $$PWD
DEFINES += QT_EGL_WAYLAND
CONFIG += egl
-QT += platformsupport-private
+QT += egl_support-private
SOURCES += $$PWD/qwaylandeglclientbufferintegration.cpp \
$$PWD/qwaylandglcontext.cpp \
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
index 5fca5610a..2a7de6b72 100644
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
@@ -42,7 +42,7 @@
#include "qwaylandxcompositeeglwindow.h"
#include <QtCore/QDebug>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
index 0194878a3..e2e2f5519 100644
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
+++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
@@ -44,7 +44,7 @@
#include <QtCore/QDebug>
#include <QtGui/QRegion>
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
index f655dee21..83a643757 100644
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
+++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
@@ -44,7 +44,7 @@
#include "qwaylandxcompositeeglclientbufferintegration.h"
-#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
+#include <QtEglSupport/private/qeglplatformcontext_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp
index f9b6fc1de..cfc0cda10 100644
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp
+++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp
@@ -40,8 +40,8 @@
#include "qwaylandxcompositeeglwindow.h"
#include "qwaylandxcompositebuffer.h"
-#include <QtPlatformSupport/private/qeglconvenience_p.h>
-#include <QtPlatformSupport/private/qxlibeglintegration_p.h>
+#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtEglSupport/private/qxlibeglintegration_p.h>
#include "wayland-xcomposite-client-protocol.h"
diff --git a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
index 52653c4ae..3a5fcb543 100644
--- a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
+++ b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
@@ -8,7 +8,7 @@ include($$PWD/../xcomposite_share/xcomposite_share.pri)
LIBS += -lXcomposite -lX11
}
-QT += platformsupport-private
+QT += egl_support-private
CONFIG += egl
SOURCES += \
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
index 862ed928b..5847ea976 100644
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
+++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
@@ -43,7 +43,7 @@
#include <qpa/qplatformopenglcontext.h>
#include "qwaylandxcompositeglxintegration.h"
-#include <QtPlatformSupport/private/qglxconvenience_p.h>
+#include <QtGlxSupport/private/qglxconvenience_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
index 11c051728..bc072bf05 100644
--- a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
+++ b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
@@ -8,7 +8,7 @@ include ($$PWD/../xcomposite_share/xcomposite_share.pri)
LIBS += -lXcomposite -lGL -lX11
}
-QT += platformsupport-private
+QT += glx_support-private
SOURCES += \
$$PWD/qwaylandxcompositeglxcontext.cpp \
diff --git a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri
index 8dacc130b..f36474890 100644
--- a/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri
+++ b/src/hardwareintegration/compositor/wayland-egl/wayland-egl.pri
@@ -8,6 +8,7 @@ INCLUDEPATH += $$PWD
}
CONFIG += egl
+QT += egl_support-private
SOURCES += \
$$PWD/waylandeglclientbufferintegration.cpp
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index 3814442c4..8b87db971 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -49,7 +49,7 @@
#include <QMutex>
#include <QMutexLocker>
#include <QtCore/private/qcore_unix_p.h>
-#include <QtPlatformSupport/private/qeglstreamconvenience_p.h>
+#include <QtEglSupport/private/qeglstreamconvenience_p.h>
#ifndef GL_TEXTURE_EXTERNAL_OES
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
diff --git a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro
index 7374a5982..9ddd961c7 100644
--- a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro
+++ b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro
@@ -1,4 +1,4 @@
-QT = waylandcompositor waylandcompositor-private core-private gui-private platformsupport-private
+QT = waylandcompositor waylandcompositor-private core-private gui-private
OTHER_FILES += wayland-egl.json
diff --git a/tests/auto/client/client/mockcompositor.cpp b/tests/auto/client/client/mockcompositor.cpp
index 45a35ea7d..2c5f2541f 100644
--- a/tests/auto/client/client/mockcompositor.cpp
+++ b/tests/auto/client/client/mockcompositor.cpp
@@ -362,10 +362,8 @@ void Compositor::addSurface(Surface *surface)
void Compositor::removeSurface(Surface *surface)
{
m_surfaces.removeOne(surface);
- if (m_keyboard->focus() == surface)
- m_keyboard->setFocus(0);
- if (m_pointer->focus() == surface)
- m_pointer->setFocus(0, QPoint());
+ m_keyboard->handleSurfaceDestroyed(surface);
+ m_pointer->handleSurfaceDestroyed(surface);
}
}
diff --git a/tests/auto/client/client/mockinput.cpp b/tests/auto/client/client/mockinput.cpp
index fe06bf79b..99acdd43a 100644
--- a/tests/auto/client/client/mockinput.cpp
+++ b/tests/auto/client/client/mockinput.cpp
@@ -267,6 +267,14 @@ void Keyboard::setFocus(Surface *surface)
m_focus = surface;
}
+void Keyboard::handleSurfaceDestroyed(Surface *surface)
+{
+ if (surface == m_focus) {
+ m_focusResource = nullptr;
+ m_focus = nullptr;
+ }
+}
+
void Keyboard::sendKey(uint32_t key, uint32_t state)
{
if (m_focusResource) {
@@ -314,6 +322,14 @@ void Pointer::setFocus(Surface *surface, const QPoint &pos)
m_focus = surface;
}
+void Pointer::handleSurfaceDestroyed(Surface *surface)
+{
+ if (m_focus == surface) {
+ m_focus = nullptr;
+ m_focusResource = nullptr;
+ }
+}
+
void Pointer::sendMotion(const QPoint &pos)
{
if (m_focusResource)
diff --git a/tests/auto/client/client/mockinput.h b/tests/auto/client/client/mockinput.h
index 031be2a4a..7e88ffb0f 100644
--- a/tests/auto/client/client/mockinput.h
+++ b/tests/auto/client/client/mockinput.h
@@ -75,6 +75,7 @@ public:
Surface *focus() const { return m_focus; }
void setFocus(Surface *surface);
+ void handleSurfaceDestroyed(Surface *surface);
void sendKey(uint32_t key, uint32_t state);
@@ -97,6 +98,7 @@ public:
Surface *focus() const { return m_focus; }
void setFocus(Surface *surface, const QPoint &pos);
+ void handleSurfaceDestroyed(Surface *surface);
void sendMotion(const QPoint &pos);
void sendButton(uint32_t button, uint32_t state);