diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-15 09:07:48 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-15 09:07:48 +0200 |
commit | b3eba26e6f1de63b1de39e1895eb081b45250325 (patch) | |
tree | 55dea47c2ed0fd261ce76031aebd7123e236a125 /src | |
parent | a64dcb7416fd5c0100ad176adf26f30b826cbfd6 (diff) | |
parent | a727ee0b2f1044ad8d5689208aed3f469b8de1ba (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/client/qwaylandintegration.cpp
Change-Id: I29120f06d33c2d383a41cf35ca4a59f5d8548ad7
Diffstat (limited to 'src')
95 files changed, 1002 insertions, 94 deletions
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h index 9a38b6d2f..9534934fa 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H #define QWAYLANDCLIENTBUFFERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h index 24063c2b9..54590a29a 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H #define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QStringList> diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h index f2c0bc08d..dae7aa009 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/qplugin.h> diff --git a/src/client/hardwareintegration/qwaylandhardwareintegration_p.h b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h index c672b2b27..466f0b20b 100644 --- a/src/client/hardwareintegration/qwaylandhardwareintegration_p.h +++ b/src/client/hardwareintegration/qwaylandhardwareintegration_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDHARDWAREINTEGRATION_H #define QWAYLANDHARDWAREINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwayland-hardware-integration.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h index 286860c36..ad2835599 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegration_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATION_H #define QWAYLANDSERVERBUFFERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QSize> #include <QtGui/qopengl.h> diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h index 6daa2e074..4eeb37169 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H #define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QStringList> diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h index 51d64512a..5d0d5d2fd 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/qplugin.h> diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h index 3feb88684..f3c59c898 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegration_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDINPUTDEVICEINTEGRATION_H #define QWAYLANDINPUTDEVICEINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h index 1eddca862..69ab61cf8 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H #define QWAYLANDINPUTDEVICEINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QStringList> diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h index ab646417d..0cb89ebac 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H #define QWAYLANDINPUTDEVICEINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/qplugin.h> diff --git a/src/client/qwaylandabstractdecoration_p.h b/src/client/qwaylandabstractdecoration_p.h index e489c09a0..ff4ea45a8 100644 --- a/src/client/qwaylandabstractdecoration_p.h +++ b/src/client/qwaylandabstractdecoration_p.h @@ -35,6 +35,17 @@ #ifndef QWAYLANDABSTRACTDECORATION_H #define QWAYLANDABSTRACTDECORATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QMargins> #include <QtCore/QPointF> #include <QtGui/QGuiApplication> diff --git a/src/client/qwaylandbuffer_p.h b/src/client/qwaylandbuffer_p.h index e1a891d12..6f8f7b269 100644 --- a/src/client/qwaylandbuffer_p.h +++ b/src/client/qwaylandbuffer_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDBUFFER_H #define QWAYLANDBUFFER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QSize> diff --git a/src/client/qwaylandclientexport_p.h b/src/client/qwaylandclientexport_p.h index 993c900be..2938025f0 100644 --- a/src/client/qwaylandclientexport_p.h +++ b/src/client/qwaylandclientexport_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTEXPORT_H #define QWAYLANDCLIENTEXPORT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE diff --git a/src/client/qwaylandclipboard_p.h b/src/client/qwaylandclipboard_p.h index 26cbbaeec..02223076e 100644 --- a/src/client/qwaylandclipboard_p.h +++ b/src/client/qwaylandclipboard_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIPBOARD_H #define QWAYLANDCLIPBOARD_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformclipboard.h> #include <QtCore/QVariant> diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h index 02023dd55..0cc1173f8 100644 --- a/src/client/qwaylandcursor_p.h +++ b/src/client/qwaylandcursor_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCURSOR_H #define QWAYLANDCURSOR_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformcursor.h> #include <QtCore/QMap> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index d6d38d681..b87529e9b 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -41,6 +41,17 @@ #ifndef QWAYLANDDATADEVICE_H #define QWAYLANDDATADEVICE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QPoint> diff --git a/src/client/qwaylanddatadevicemanager_p.h b/src/client/qwaylanddatadevicemanager_p.h index 151197e3b..85b4b3f74 100644 --- a/src/client/qwaylanddatadevicemanager_p.h +++ b/src/client/qwaylanddatadevicemanager_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDATADEVICEMANAGER_H #define QWAYLANDDATADEVICEMANAGER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtWaylandClient/private/qwayland-wayland.h> diff --git a/src/client/qwaylanddataoffer_p.h b/src/client/qwaylanddataoffer_p.h index 391ceb173..b22681f7a 100644 --- a/src/client/qwaylanddataoffer_p.h +++ b/src/client/qwaylanddataoffer_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDATAOFFER_H #define QWAYLANDDATAOFFER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtGui/private/qdnd_p.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/qwaylanddatasource_p.h b/src/client/qwaylanddatasource_p.h index 93f1f4681..c753c4f6e 100644 --- a/src/client/qwaylanddatasource_p.h +++ b/src/client/qwaylanddatasource_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDATASOURCE_H #define QWAYLANDDATASOURCE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QtWaylandClient/private/qwayland-wayland.h> diff --git a/src/client/qwaylanddecorationfactory_p.h b/src/client/qwaylanddecorationfactory_p.h index de830aaf0..0a0e09d64 100644 --- a/src/client/qwaylanddecorationfactory_p.h +++ b/src/client/qwaylanddecorationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDECORATIONFACTORY_H #define QWAYLANDDECORATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QStringList> diff --git a/src/client/qwaylanddecorationplugin_p.h b/src/client/qwaylanddecorationplugin_p.h index 9f19b2948..762274e32 100644 --- a/src/client/qwaylanddecorationplugin_p.h +++ b/src/client/qwaylanddecorationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDECORATIONPLUGIN_H #define QWAYLANDDECORATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/qplugin.h> diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 0dd7bdfa6..ccd189477 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -154,12 +154,7 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration) mEventThreadObject->displayConnect(); mDisplay = mEventThreadObject->display(); //blocks until display is available - //Create a new even queue for the QtGui thread - mEventQueue = wl_display_create_queue(mDisplay); - struct ::wl_registry *registry = wl_display_get_registry(mDisplay); - wl_proxy_set_queue((struct wl_proxy *)registry, mEventQueue); - init(registry); connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests())); @@ -187,7 +182,7 @@ QWaylandDisplay::~QWaylandDisplay(void) void QWaylandDisplay::flushRequests() { - if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0) { + if (wl_display_dispatch_pending(mDisplay) < 0) { mEventThreadObject->checkError(); exitWithError(); } @@ -198,7 +193,7 @@ void QWaylandDisplay::flushRequests() void QWaylandDisplay::blockingReadEvents() { - if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0) { + if (wl_display_dispatch(mDisplay) < 0) { mEventThreadObject->checkError(); exitWithError(); } @@ -206,6 +201,8 @@ void QWaylandDisplay::blockingReadEvents() void QWaylandDisplay::exitWithError() { + mEventThread->quit(); + mEventThread->wait(); ::exit(1); } @@ -348,17 +345,16 @@ void QWaylandDisplay::forceRoundTrip() int ret = 0; bool done = false; wl_callback *callback = wl_display_sync(mDisplay); - wl_proxy_set_queue((struct wl_proxy *)callback, mEventQueue); wl_callback_add_listener(callback, &sync_listener, &done); flushRequests(); if (QThread::currentThread()->eventDispatcher()) { while (!done && ret >= 0) { QThread::currentThread()->eventDispatcher()->processEvents(QEventLoop::WaitForMoreEvents); - ret = wl_display_dispatch_queue_pending(mDisplay, mEventQueue); + ret = wl_display_dispatch_pending(mDisplay); } } else { while (!done && ret >= 0) - ret = wl_display_dispatch_queue(mDisplay, mEventQueue); + ret = wl_display_dispatch(mDisplay); } if (ret == -1 && !done) diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index 84e94a61d..664407b88 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDISPLAY_H #define QWAYLANDDISPLAY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QObject> #include <QtCore/QRect> #include <QtCore/QPointer> @@ -110,7 +121,6 @@ public: void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); struct wl_display *wl_display() const { return mDisplay; } - struct wl_event_queue *wl_event_queue() const { return mEventQueue; } struct ::wl_registry *wl_registry() { return object(); } const struct wl_compositor *wl_compositor() const { return mCompositor.object(); } @@ -175,7 +185,6 @@ private: }; struct wl_display *mDisplay; - struct wl_event_queue *mEventQueue; QtWayland::wl_compositor mCompositor; QScopedPointer<QWaylandShm> mShm; QThread *mEventThread; diff --git a/src/client/qwaylanddnd_p.h b/src/client/qwaylanddnd_p.h index 19b1f92ed..42848a1d8 100644 --- a/src/client/qwaylanddnd_p.h +++ b/src/client/qwaylanddnd_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDDND_H #define QWAYLANDDND_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformdrag.h> #include <QtGui/private/qsimpledrag_p.h> diff --git a/src/client/qwaylandeventthread.cpp b/src/client/qwaylandeventthread.cpp index e2e21c9e7..e0a3edcb8 100644 --- a/src/client/qwaylandeventthread.cpp +++ b/src/client/qwaylandeventthread.cpp @@ -80,13 +80,9 @@ void QWaylandEventThread::checkError() const void QWaylandEventThread::readWaylandEvents() { - if (wl_display_dispatch(m_display) < 0) { - checkError(); - m_readNotifier->setEnabled(false); - emit fatalError(); - return; + if (wl_display_prepare_read(m_display) == 0) { + wl_display_read_events(m_display); } - emit newEventsRead(); } diff --git a/src/client/qwaylandeventthread_p.h b/src/client/qwaylandeventthread_p.h index cd64b7046..0920d403e 100644 --- a/src/client/qwaylandeventthread_p.h +++ b/src/client/qwaylandeventthread_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDEVENTTHREAD_H #define QWAYLANDEVENTTHREAD_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <QMutex> #include <wayland-client.h> diff --git a/src/client/qwaylandextendedsurface_p.h b/src/client/qwaylandextendedsurface_p.h index efd7a0b2b..2ed3a2276 100644 --- a/src/client/qwaylandextendedsurface_p.h +++ b/src/client/qwaylandextendedsurface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDEXTENDEDSURFACE_H #define QWAYLANDEXTENDEDSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QString> #include <QtCore/QVariant> diff --git a/src/client/qwaylandinputcontext_p.h b/src/client/qwaylandinputcontext_p.h index 522e95fff..679baa497 100644 --- a/src/client/qwaylandinputcontext_p.h +++ b/src/client/qwaylandinputcontext_p.h @@ -41,6 +41,17 @@ #ifndef QWAYLANDINPUTCONTEXT_H #define QWAYLANDINPUTCONTEXT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatforminputcontext.h> #include <QtWaylandClient/private/qwayland-text.h> diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 6f3b25c06..8bfb45cd4 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDINPUTDEVICE_H #define QWAYLANDINPUTDEVICE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandwindow_p.h> #include <QSocketNotifier> diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index c8d121766..407d90b94 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -128,14 +128,19 @@ QWaylandIntegration::QWaylandIntegration() mClipboard = new QWaylandClipboard(mDisplay); mDrag = new QWaylandDrag(mDisplay); - //try to use the input context using the wl_text_input interface - QPlatformInputContext *ctx = new QWaylandInputContext(mDisplay); - mInputContext.reset(ctx); - - //use the traditional way for on screen keyboards for now - if (!mInputContext.data()->isValid()) { - ctx = QPlatformInputContextFactory::create(); + 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); mInputContext.reset(ctx); + + //use the traditional way for on screen keyboards for now + if (!mInputContext.data()->isValid()) { + ctx = QPlatformInputContextFactory::create(); + mInputContext.reset(ctx); + } } } diff --git a/src/client/qwaylandintegration_p.h b/src/client/qwaylandintegration_p.h index ef180cdaf..42bc287b5 100644 --- a/src/client/qwaylandintegration_p.h +++ b/src/client/qwaylandintegration_p.h @@ -34,6 +34,17 @@ #ifndef QPLATFORMINTEGRATION_WAYLAND_H #define QPLATFORMINTEGRATION_WAYLAND_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformintegration.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/qwaylandnativeinterface.cpp b/src/client/qwaylandnativeinterface.cpp index 8170c39f1..0d20075f0 100644 --- a/src/client/qwaylandnativeinterface.cpp +++ b/src/client/qwaylandnativeinterface.cpp @@ -58,8 +58,6 @@ void *QWaylandNativeInterface::nativeResourceForIntegration(const QByteArray &re if (lowerCaseResource == "display" || lowerCaseResource == "wl_display" || lowerCaseResource == "nativedisplay") return m_integration->display()->wl_display(); - if (lowerCaseResource == "wl_event_queue") - return m_integration->display()->wl_event_queue(); if (lowerCaseResource == "compositor") return const_cast<wl_compositor *>(m_integration->display()->wl_compositor()); if (lowerCaseResource == "server_buffer_integration") diff --git a/src/client/qwaylandnativeinterface_p.h b/src/client/qwaylandnativeinterface_p.h index 04a46075d..7050f9758 100644 --- a/src/client/qwaylandnativeinterface_p.h +++ b/src/client/qwaylandnativeinterface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDNATIVEINTERFACE_H #define QWAYLANDNATIVEINTERFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QVariantMap> #include <qpa/qplatformnativeinterface.h> diff --git a/src/client/qwaylandqtkey_p.h b/src/client/qwaylandqtkey_p.h index 322549d5b..2e9c7a255 100644 --- a/src/client/qwaylandqtkey_p.h +++ b/src/client/qwaylandqtkey_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDQTKEY_H #define QWAYLANDQTKEY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qwindowsysteminterface.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h index 3d38e30a8..e3e1515d4 100644 --- a/src/client/qwaylandscreen_p.h +++ b/src/client/qwaylandscreen_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSCREEN_H #define QWAYLANDSCREEN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qplatformscreen.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/qwaylandshellsurface_p.h b/src/client/qwaylandshellsurface_p.h index 2fb7ff9af..726d103f9 100644 --- a/src/client/qwaylandshellsurface_p.h +++ b/src/client/qwaylandshellsurface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHELLSURFACE_H #define QWAYLANDSHELLSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QSize> #include <QObject> diff --git a/src/client/qwaylandshmbackingstore_p.h b/src/client/qwaylandshmbackingstore_p.h index 17e84f3cd..a1a6e19c3 100644 --- a/src/client/qwaylandshmbackingstore_p.h +++ b/src/client/qwaylandshmbackingstore_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHMBACKINGSTORE_H #define QWAYLANDSHMBACKINGSTORE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandbuffer_p.h> #include <qpa/qplatformbackingstore.h> diff --git a/src/client/qwaylandshmwindow_p.h b/src/client/qwaylandshmwindow_p.h index b046c5d84..a0a5edffd 100644 --- a/src/client/qwaylandshmwindow_p.h +++ b/src/client/qwaylandshmwindow_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHMWINDOW_H #define QWAYLANDSHMWINDOW_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandwindow_p.h> #include <QtGui/QRegion> diff --git a/src/client/qwaylandsubsurface_p.h b/src/client/qwaylandsubsurface_p.h index 75d8cf6a0..4cbb99251 100644 --- a/src/client/qwaylandsubsurface_p.h +++ b/src/client/qwaylandsubsurface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSUBSURFACE_H #define QWAYLANDSUBSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <wayland-client.h> #include <QtCore/qglobal.h> diff --git a/src/client/qwaylandtouch_p.h b/src/client/qwaylandtouch_p.h index 2dda6243a..394ae6d36 100644 --- a/src/client/qwaylandtouch_p.h +++ b/src/client/qwaylandtouch_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDTOUCH_H #define QWAYLANDTOUCH_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <qpa/qwindowsysteminterface.h> #include <QtWaylandClient/private/qwayland-touch-extension.h> diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index a54979a2f..ed7b656d9 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -156,7 +156,8 @@ void QWaylandWindow::initWindow() mShellSurface->updateTransientParent(window()->transientParent()); } } else { - mShellSurface->setTopLevel(); + if (window()->type() != Qt::ToolTip) + mShellSurface->setTopLevel(); } } @@ -266,17 +267,18 @@ void QWaylandWindow::setGeometry(const QRect &rect) void QWaylandWindow::setVisible(bool visible) { if (visible) { - if (window()->type() == Qt::Popup) { - QWaylandWindow *parent = transientParent(); - if (!parent) { - // Try with the current focus window. It should be the right one and anyway - // better than having no parent at all. - parent = mDisplay->lastInputWindow(); - } - if (parent) { - QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface); - if (wlshellSurface) - wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial()); + if (mShellSurface) { + if (window()->type() == Qt::Popup) { + QWaylandWindow *parent = transientParent(); + if (parent) { + QWaylandWlShellSurface *wlshellSurface = qobject_cast<QWaylandWlShellSurface*>(mShellSurface); + if (wlshellSurface) + wlshellSurface->setPopup(parent, mDisplay->lastInputDevice(), mDisplay->lastInputSerial()); + } + } else if (window()->type() == Qt::ToolTip) { + if (QWaylandWindow *parent = transientParent()) { + mShellSurface->updateTransientParent(parent->window()); + } } } @@ -643,7 +645,9 @@ QWaylandWindow *QWaylandWindow::transientParent() const // events. return static_cast<QWaylandWindow *>(topLevelWindow(window()->transientParent())->handle()); } - return 0; + // Try with the current focus window. It should be the right one and anyway + // better than having no parent at all. + return mDisplay->lastInputWindow(); } void QWaylandWindow::handleMouse(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e) diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h index 6b9af1031..be8f53088 100644 --- a/src/client/qwaylandwindow_p.h +++ b/src/client/qwaylandwindow_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDWINDOW_H #define QWAYLANDWINDOW_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QWaitCondition> #include <QtCore/QMutex> #include <QtGui/QIcon> diff --git a/src/client/qwaylandwindowmanagerintegration.cpp b/src/client/qwaylandwindowmanagerintegration.cpp index 56fe7c5a3..5e8a628bf 100644 --- a/src/client/qwaylandwindowmanagerintegration.cpp +++ b/src/client/qwaylandwindowmanagerintegration.cpp @@ -127,28 +127,33 @@ QByteArray QWaylandWindowManagerIntegration::desktopEnvironment() const void QWaylandWindowManagerIntegration::openUrl_helper(const QUrl &url) { - if (isInitialized()) { - QByteArray data = url.toString().toUtf8(); - - static const int chunkSize = 128; - while (!data.isEmpty()) { - QByteArray chunk = data.left(chunkSize); - data = data.mid(chunkSize); - open_url(!data.isEmpty(), QString::fromUtf8(chunk)); - } + Q_ASSERT(isInitialized()); + QByteArray data = url.toString().toUtf8(); + + static const int chunkSize = 128; + while (!data.isEmpty()) { + QByteArray chunk = data.left(chunkSize); + data = data.mid(chunkSize); + open_url(!data.isEmpty(), QString::fromUtf8(chunk)); } } bool QWaylandWindowManagerIntegration::openUrl(const QUrl &url) { - openUrl_helper(url); - return true; + if (isInitialized()) { + openUrl_helper(url); + return true; + } + return QGenericUnixServices::openUrl(url); } bool QWaylandWindowManagerIntegration::openDocument(const QUrl &url) { - openUrl_helper(url); - return true; + if (isInitialized()) { + openUrl_helper(url); + return true; + } + return QGenericUnixServices::openDocument(url); } } diff --git a/src/client/qwaylandwindowmanagerintegration_p.h b/src/client/qwaylandwindowmanagerintegration_p.h index 612cda43e..73c1b29e8 100644 --- a/src/client/qwaylandwindowmanagerintegration_p.h +++ b/src/client/qwaylandwindowmanagerintegration_p.h @@ -34,11 +34,22 @@ #ifndef QWAYLANDWINDOWMANAGERINTEGRATION_H #define QWAYLANDWINDOWMANAGERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QObject> #include <QtCore/QScopedPointer> #include <wayland-client.h> -#include <qpa/qplatformservices.h> +#include <QtPlatformSupport/private/qgenericunixservices_p.h> #include <QtWaylandClient/private/qwayland-windowmanager.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> @@ -52,7 +63,7 @@ class QWaylandDisplay; class QWaylandWindowManagerIntegrationPrivate; -class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QPlatformServices, public QtWayland::qt_windowmanager +class Q_WAYLAND_CLIENT_EXPORT QWaylandWindowManagerIntegration : public QObject, public QGenericUnixServices, public QtWayland::qt_windowmanager { Q_OBJECT Q_DECLARE_PRIVATE(QWaylandWindowManagerIntegration) diff --git a/src/client/qwaylandwlshellsurface.cpp b/src/client/qwaylandwlshellsurface.cpp index 8888dbf4d..7235931d3 100644 --- a/src/client/qwaylandwlshellsurface.cpp +++ b/src/client/qwaylandwlshellsurface.cpp @@ -47,8 +47,8 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_surface, QWaylandWindow *window) - : QtWayland::wl_shell_surface(shell_surface) - , QWaylandShellSurface(window) + : QWaylandShellSurface(window) + , QtWayland::wl_shell_surface(shell_surface) , m_window(window) , m_maximized(false) , m_fullscreen(false) @@ -159,8 +159,7 @@ void QWaylandWlShellSurface::updateTransientParent(QWindow *parent) // set_transient expects a position relative to the parent QPoint transientPos = m_window->geometry().topLeft(); // this is absolute - QWindow *parentWin = m_window->window()->transientParent(); - transientPos -= parentWin->geometry().topLeft(); + transientPos -= parent->geometry().topLeft(); if (parent_wayland_window->decoration()) { transientPos.setX(transientPos.x() + parent_wayland_window->decoration()->margins().left()); transientPos.setY(transientPos.y() + parent_wayland_window->decoration()->margins().top()); diff --git a/src/client/qwaylandwlshellsurface_p.h b/src/client/qwaylandwlshellsurface_p.h index 47d4467ce..78216a4c3 100644 --- a/src/client/qwaylandwlshellsurface_p.h +++ b/src/client/qwaylandwlshellsurface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDWLSHELLSURFACE_H #define QWAYLANDWLSHELLSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QSize> #include <wayland-client.h> diff --git a/src/client/qwaylandxdgshell_p.h b/src/client/qwaylandxdgshell_p.h index 954dc5707..3fd248fc4 100644 --- a/src/client/qwaylandxdgshell_p.h +++ b/src/client/qwaylandxdgshell_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDXDGSHELL_H #define QWAYLANDXDGSHELL_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QSize> #include <wayland-client.h> diff --git a/src/client/qwaylandxdgsurface.cpp b/src/client/qwaylandxdgsurface.cpp index fd8368951..c89e230db 100644 --- a/src/client/qwaylandxdgsurface.cpp +++ b/src/client/qwaylandxdgsurface.cpp @@ -46,8 +46,8 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { QWaylandXdgSurface::QWaylandXdgSurface(struct ::xdg_surface *xdg_surface, QWaylandWindow *window) - : QtWayland::xdg_surface(xdg_surface) - , QWaylandShellSurface(window) + : QWaylandShellSurface(window) + , QtWayland::xdg_surface(xdg_surface) , m_window(window) , m_maximized(false) , m_minimized(false) diff --git a/src/client/qwaylandxdgsurface_p.h b/src/client/qwaylandxdgsurface_p.h index 1a53a772d..8deafef77 100644 --- a/src/client/qwaylandxdgsurface_p.h +++ b/src/client/qwaylandxdgsurface_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDXDGSURFACE_H #define QWAYLANDXDGSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QSize> #include <QtCore/QMargins> diff --git a/src/client/shellintegration/qwaylandshellintegration_p.h b/src/client/shellintegration/qwaylandshellintegration_p.h index a4b40b088..f8e741520 100644 --- a/src/client/shellintegration/qwaylandshellintegration_p.h +++ b/src/client/shellintegration/qwaylandshellintegration_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHELLINTEGRATION_H #define QWAYLANDSHELLINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #include <QtWaylandClient/private/qwaylandclientexport_p.h> diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h index 873e57aec..7ec49521c 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHELLINTEGRATIONFACTORY_H #define QWAYLANDSHELLINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/QStringList> diff --git a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h index 9bae57cc9..9193fb071 100644 --- a/src/client/shellintegration/qwaylandshellintegrationplugin_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSHELLINTEGRATIONPLUGIN_H #define QWAYLANDSHELLINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtWaylandClient/private/qwaylandclientexport_p.h> #include <QtCore/qplugin.h> diff --git a/src/compositor/compositor_api/qwaylandquicksurface.cpp b/src/compositor/compositor_api/qwaylandquicksurface.cpp index ce33530ce..3d52b8624 100644 --- a/src/compositor/compositor_api/qwaylandquicksurface.cpp +++ b/src/compositor/compositor_api/qwaylandquicksurface.cpp @@ -137,8 +137,6 @@ bool QWaylandQuickSurface::event(QEvent *e) this, &QWaylandQuickSurface::updateTexture); disconnect(oldWindow, &QQuickWindow::sceneGraphInvalidated, this, &QWaylandQuickSurface::invalidateTexture); - disconnect(oldWindow, &QQuickWindow::sceneGraphAboutToStop, - this, &QWaylandQuickSurface::invalidateTexture); } return true; @@ -155,9 +153,6 @@ bool QWaylandQuickSurface::event(QEvent *e) connect(window, &QQuickWindow::sceneGraphInvalidated, this, &QWaylandQuickSurface::invalidateTexture, Qt::DirectConnection); - connect(window, &QQuickWindow::sceneGraphAboutToStop, - this, &QWaylandQuickSurface::invalidateTexture, - Qt::DirectConnection); } return true; diff --git a/src/compositor/compositor_api/qwaylandsurface_p.h b/src/compositor/compositor_api/qwaylandsurface_p.h index 4444df7a9..383a523b2 100644 --- a/src/compositor/compositor_api/qwaylandsurface_p.h +++ b/src/compositor/compositor_api/qwaylandsurface_p.h @@ -35,6 +35,17 @@ #ifndef QWAYLANDSURFACE_P_H #define QWAYLANDSURFACE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <private/qobject_p.h> diff --git a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp index e1d9d8fdd..e964c9177 100644 --- a/src/compositor/compositor_api/qwaylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp @@ -250,6 +250,10 @@ void QWaylandSurfaceItem::touchEvent(QTouchEvent *event) inputDevice->setMouseFocus(this, pointPos, pointPos); } inputDevice->sendFullTouchEvent(event); + + const bool isEnd = event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel; + if (isEnd && window()->mouseGrabberItem() == this) + ungrabMouse(); } else { event->ignore(); } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h index 15712ea1e..e4bbb45b9 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegration_p.h @@ -41,6 +41,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATION_H #define QWAYLANDCLIENTBUFFERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QSize> #include <QtGui/qopengl.h> diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h index 1ee972789..0d064db26 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H #define QWAYLANDCLIENTBUFFERINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QStringList> diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h index adb7440fc..2b3604480 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDCLIENTBUFFERINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/qplugin.h> diff --git a/src/compositor/hardware_integration/qwlhwintegration_p.h b/src/compositor/hardware_integration/qwlhwintegration_p.h index b18b6eeb1..ed5c56ba1 100644 --- a/src/compositor/hardware_integration/qwlhwintegration_p.h +++ b/src/compositor/hardware_integration/qwlhwintegration_p.h @@ -41,6 +41,17 @@ #ifndef QWLHWINTEGRATION_P_H #define QWLHWINTEGRATION_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-hardware-integration.h> #include <QtCore/QString> diff --git a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h index f8a15318c..0eef5d1f0 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegration_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegration_p.h @@ -41,6 +41,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATION_H #define QWAYLANDSERVERBUFFERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/qglobal.h> #include <QtCore/QSize> #include <QtGui/qopengl.h> diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h index 02f15556d..4d07df96f 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H #define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QStringList> diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h index c074f1596..2530ac3db 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h @@ -34,6 +34,17 @@ #ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H #define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/qplugin.h> diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index a0005a8e9..6fd63d748 100644 --- a/src/compositor/wayland_wrapper/qwlcompositor_p.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -42,6 +42,17 @@ #ifndef WL_COMPOSITOR_H #define WL_COMPOSITOR_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCompositor/qwaylandcompositor.h> diff --git a/src/compositor/wayland_wrapper/qwldatadevice_p.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 6be177dec..17e605f19 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -41,6 +41,17 @@ #ifndef WLDATADEVICE_H #define WLDATADEVICE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-wayland.h> #include <qwlpointer_p.h> diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 988066fc5..90d226d77 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -41,6 +41,17 @@ #ifndef WLDATADEVICEMANAGER_H #define WLDATADEVICEMANAGER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qwlcompositor_p.h> #include <QtCore/QList> diff --git a/src/compositor/wayland_wrapper/qwldataoffer_p.h b/src/compositor/wayland_wrapper/qwldataoffer_p.h index 8d4cd1256..cc0faa34d 100644 --- a/src/compositor/wayland_wrapper/qwldataoffer_p.h +++ b/src/compositor/wayland_wrapper/qwldataoffer_p.h @@ -41,6 +41,17 @@ #ifndef WLDATAOFFER_H #define WLDATAOFFER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QPointer> #include <QtCompositor/private/qwayland-server-wayland.h> diff --git a/src/compositor/wayland_wrapper/qwldatasource_p.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index 1ddad3634..d4d10768b 100644 --- a/src/compositor/wayland_wrapper/qwldatasource_p.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -41,6 +41,17 @@ #ifndef WLDATASOURCE_H #define WLDATASOURCE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-wayland.h> #include <QObject> #include <QtCore/QList> diff --git a/src/compositor/wayland_wrapper/qwldisplay_p.h b/src/compositor/wayland_wrapper/qwldisplay_p.h index 6ba66f951..c89bb0509 100644 --- a/src/compositor/wayland_wrapper/qwldisplay_p.h +++ b/src/compositor/wayland_wrapper/qwldisplay_p.h @@ -41,6 +41,17 @@ #ifndef WL_DISPLAY_H #define WL_DISPLAY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <wayland-server.h> #include <QtCompositor/qwaylandexport.h> diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h index 8af6232a6..88c801067 100644 --- a/src/compositor/wayland_wrapper/qwlextendedsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h @@ -41,6 +41,17 @@ #ifndef WLEXTENDEDSURFACE_H #define WLEXTENDEDSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <wayland-server.h> #include <QtCompositor/private/qwayland-server-surface-extension.h> diff --git a/src/compositor/wayland_wrapper/qwlinputdevice_p.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index 8444eaa50..f28946a9b 100644 --- a/src/compositor/wayland_wrapper/qwlinputdevice_p.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -41,6 +41,17 @@ #ifndef WLINPUTDEVICE_H #define WLINPUTDEVICE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <stdint.h> #include <QtCompositor/qwaylandexport.h> diff --git a/src/compositor/wayland_wrapper/qwlinputmethod_p.h b/src/compositor/wayland_wrapper/qwlinputmethod_p.h index f2df5c8ab..f52208a9c 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethod_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethod_p.h @@ -41,6 +41,17 @@ #ifndef QTWAYLAND_QWLINPUTMETHOD_H #define QTWAYLAND_QWLINPUTMETHOD_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-input-method.h> #include <QObject> diff --git a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h b/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h index a766d63d6..ccf236e61 100644 --- a/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h +++ b/src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h @@ -41,6 +41,17 @@ #ifndef QTWAYLAND_QWLINPUTMETHODCONTEXT_P_H #define QTWAYLAND_QWLINPUTMETHODCONTEXT_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-input-method.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlinputpanel_p.h b/src/compositor/wayland_wrapper/qwlinputpanel_p.h index a475da37c..f8880ad4a 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanel_p.h +++ b/src/compositor/wayland_wrapper/qwlinputpanel_p.h @@ -41,6 +41,17 @@ #ifndef QTWAYLAND_QWLINPUTPANEL_P_H #define QTWAYLAND_QWLINPUTPANEL_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCompositor/private/qwayland-server-input-method.h> diff --git a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h b/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h index 621ce135c..37f2e0858 100644 --- a/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h @@ -42,6 +42,17 @@ #ifndef QTWAYLAND_QWLINPUTPANELSURFACE_P_H #define QTWAYLAND_QWLINPUTPANELSURFACE_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-input-method.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwlkeyboard.cpp b/src/compositor/wayland_wrapper/qwlkeyboard.cpp index bcee40fb4..3d0af6aaf 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard.cpp +++ b/src/compositor/wayland_wrapper/qwlkeyboard.cpp @@ -72,6 +72,7 @@ Keyboard::Keyboard(Compositor *compositor, InputDevice *seat) , m_group() , m_pendingKeymap(false) #ifndef QT_NO_WAYLAND_XKB + , m_keymap_fd(-1) , m_state(0) #endif { @@ -145,14 +146,13 @@ void Keyboard::setFocus(Surface* surface) void Keyboard::setKeymap(const QWaylandKeymap &keymap) { m_keymap = keymap; + m_pendingKeymap = true; // If there is no key currently pressed, update right away the keymap // Otherwise, delay the update when keys are released // see http://lists.freedesktop.org/archives/wayland-devel/2013-October/011395.html if (m_keys.isEmpty()) { updateKeymap(); - } else { - m_pendingKeymap = true; } } @@ -349,42 +349,57 @@ void Keyboard::initXKB() createXKBKeymap(); } -void Keyboard::createXKBKeymap() +void Keyboard::createXKBState(xkb_keymap *keymap) { - if (!m_context) - return; - - if (m_state) - xkb_state_unref(m_state); - - struct xkb_rule_names rule_names = { strdup(qPrintable(m_keymap.rules())), - strdup(qPrintable(m_keymap.model())), - strdup(qPrintable(m_keymap.layout())), - strdup(qPrintable(m_keymap.variant())), - strdup(qPrintable(m_keymap.options())) }; - struct xkb_keymap *keymap = xkb_keymap_new_from_names(m_context, &rule_names, static_cast<xkb_keymap_compile_flags>(0)); - char *keymap_str = xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1); - if (!keymap_str) - qFatal("Failed to compile global XKB keymap"); + if (!keymap_str) { + qWarning("Failed to compile global XKB keymap"); + return; + } m_keymap_size = strlen(keymap_str) + 1; + if (m_keymap_fd >= 0) + close(m_keymap_fd); m_keymap_fd = createAnonymousFile(m_keymap_size); - if (m_keymap_fd < 0) - qFatal("Failed to create anonymous file of size %lu", static_cast<unsigned long>(m_keymap_size)); + if (m_keymap_fd < 0) { + qWarning("Failed to create anonymous file of size %lu", static_cast<unsigned long>(m_keymap_size)); + return; + } m_keymap_area = static_cast<char *>(mmap(0, m_keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, m_keymap_fd, 0)); if (m_keymap_area == MAP_FAILED) { close(m_keymap_fd); - qFatal("Failed to map shared memory segment"); + m_keymap_fd = -1; + qWarning("Failed to map shared memory segment"); + return; } strcpy(m_keymap_area, keymap_str); free(keymap_str); + if (m_state) + xkb_state_unref(m_state); m_state = xkb_state_new(keymap); +} + +void Keyboard::createXKBKeymap() +{ + if (!m_context) + return; - xkb_keymap_unref(keymap); + struct xkb_rule_names rule_names = { strdup(qPrintable(m_keymap.rules())), + strdup(qPrintable(m_keymap.model())), + strdup(qPrintable(m_keymap.layout())), + strdup(qPrintable(m_keymap.variant())), + strdup(qPrintable(m_keymap.options())) }; + struct xkb_keymap *keymap = xkb_keymap_new_from_names(m_context, &rule_names, static_cast<xkb_keymap_compile_flags>(0)); + + if (keymap) { + createXKBState(keymap); + xkb_keymap_unref(keymap); + } else { + qWarning("Failed to load the '%s' XKB keymap.", qPrintable(m_keymap.layout())); + } free((char *)rule_names.rules); free((char *)rule_names.model); diff --git a/src/compositor/wayland_wrapper/qwlkeyboard_p.h b/src/compositor/wayland_wrapper/qwlkeyboard_p.h index d394aad1b..e47bd2102 100644 --- a/src/compositor/wayland_wrapper/qwlkeyboard_p.h +++ b/src/compositor/wayland_wrapper/qwlkeyboard_p.h @@ -42,6 +42,17 @@ #ifndef QTWAYLAND_QWLKEYBOARD_P_H #define QTWAYLAND_QWLKEYBOARD_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCompositor/qwaylandinput.h> @@ -127,6 +138,7 @@ private: #ifndef QT_NO_WAYLAND_XKB void initXKB(); void createXKBKeymap(); + void createXKBState(xkb_keymap *keymap); #endif Compositor *m_compositor; diff --git a/src/compositor/wayland_wrapper/qwllistener_p.h b/src/compositor/wayland_wrapper/qwllistener_p.h index addc9a1fb..296a081ab 100644 --- a/src/compositor/wayland_wrapper/qwllistener_p.h +++ b/src/compositor/wayland_wrapper/qwllistener_p.h @@ -34,6 +34,17 @@ #ifndef QTWAYLAND_QWLLISTENER_H #define QTWAYLAND_QWLLISTENER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QObject> #include <wayland-server.h> diff --git a/src/compositor/wayland_wrapper/qwloutput_p.h b/src/compositor/wayland_wrapper/qwloutput_p.h index b85081e80..3efd49fb6 100644 --- a/src/compositor/wayland_wrapper/qwloutput_p.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -42,6 +42,17 @@ #ifndef WL_OUTPUT_H #define WL_OUTPUT_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QRect> diff --git a/src/compositor/wayland_wrapper/qwlpointer_p.h b/src/compositor/wayland_wrapper/qwlpointer_p.h index db2932d04..b50350d8b 100644 --- a/src/compositor/wayland_wrapper/qwlpointer_p.h +++ b/src/compositor/wayland_wrapper/qwlpointer_p.h @@ -42,6 +42,17 @@ #ifndef QTWAYLAND_QWLPOINTER_P_H #define QTWAYLAND_QWLPOINTER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QList> diff --git a/src/compositor/wayland_wrapper/qwlqtkey_p.h b/src/compositor/wayland_wrapper/qwlqtkey_p.h index 2b10c8f71..938fa0b84 100644 --- a/src/compositor/wayland_wrapper/qwlqtkey_p.h +++ b/src/compositor/wayland_wrapper/qwlqtkey_p.h @@ -41,6 +41,17 @@ #ifndef WLQTKEY_H #define WLQTKEY_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qwlcompositor_p.h> #include "wayland-util.h" diff --git a/src/compositor/wayland_wrapper/qwlqttouch_p.h b/src/compositor/wayland_wrapper/qwlqttouch_p.h index e5215def6..003f783dc 100644 --- a/src/compositor/wayland_wrapper/qwlqttouch_p.h +++ b/src/compositor/wayland_wrapper/qwlqttouch_p.h @@ -41,6 +41,17 @@ #ifndef WLTOUCH_H #define WLTOUCH_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qwlcompositor_p.h> #include <QtCompositor/private/qwayland-server-touch-extension.h> #include "wayland-util.h" diff --git a/src/compositor/wayland_wrapper/qwlregion_p.h b/src/compositor/wayland_wrapper/qwlregion_p.h index 7fc92f071..4df39602b 100644 --- a/src/compositor/wayland_wrapper/qwlregion_p.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -41,6 +41,17 @@ #ifndef WL_REGION_H #define WL_REGION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QRegion> diff --git a/src/compositor/wayland_wrapper/qwlshellsurface_p.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h index 672606229..fab2a5c0b 100644 --- a/src/compositor/wayland_wrapper/qwlshellsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlshellsurface_p.h @@ -41,6 +41,17 @@ #ifndef WLSHELLSURFACE_H #define WLSHELLSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCompositor/qwaylandsurface.h> #include <QtCompositor/qwaylandglobalinterface.h> diff --git a/src/compositor/wayland_wrapper/qwlsubsurface_p.h b/src/compositor/wayland_wrapper/qwlsubsurface_p.h index 7cd46efa0..2046ec62b 100644 --- a/src/compositor/wayland_wrapper/qwlsubsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsubsurface_p.h @@ -41,6 +41,17 @@ #ifndef WLSUBSURFACE_H #define WLSUBSURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <private/qwlsurface_p.h> #include <QtCompositor/private/qwayland-server-wayland.h> diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index a1c05d1ef..eb79d9c10 100644 --- a/src/compositor/wayland_wrapper/qwlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -451,6 +451,14 @@ void Surface::surface_destroy_resource(Resource *) m_extendedSurface = 0; } + if (transientParent()) { + foreach (Surface *surface, compositor()->surfaces()) { + if (surface->transientParent() == this) { + surface->setTransientParent(0); + } + } + } + m_destroyed = true; m_waylandSurface->destroy(); emit m_waylandSurface->surfaceDestroyed(); diff --git a/src/compositor/wayland_wrapper/qwlsurface_p.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 5875da106..9cb9b5145 100644 --- a/src/compositor/wayland_wrapper/qwlsurface_p.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -41,6 +41,17 @@ #ifndef WL_SURFACE_H #define WL_SURFACE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <private/qwlsurfacebuffer_p.h> diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 580e71d0b..5d09c5a9f 100644 --- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -41,6 +41,17 @@ #ifndef SURFACEBUFFER_H #define SURFACEBUFFER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCore/QRect> #include <QtGui/qopengl.h> #include <QImage> diff --git a/src/compositor/wayland_wrapper/qwltextinput_p.h b/src/compositor/wayland_wrapper/qwltextinput_p.h index 2618e296a..da09bca4f 100644 --- a/src/compositor/wayland_wrapper/qwltextinput_p.h +++ b/src/compositor/wayland_wrapper/qwltextinput_p.h @@ -41,6 +41,17 @@ #ifndef QTWAYLAND_QWLTEXTINPUT_P_H #define QTWAYLAND_QWLTEXTINPUT_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-text.h> #include <QRect> diff --git a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h b/src/compositor/wayland_wrapper/qwltextinputmanager_p.h index 049929c0c..4cb088e93 100644 --- a/src/compositor/wayland_wrapper/qwltextinputmanager_p.h +++ b/src/compositor/wayland_wrapper/qwltextinputmanager_p.h @@ -41,6 +41,17 @@ #ifndef QTWAYLAND_QWLTEXTINPUTMANAGER_P_H #define QTWAYLAND_QWLTEXTINPUTMANAGER_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/private/qwayland-server-text.h> QT_BEGIN_NAMESPACE diff --git a/src/compositor/wayland_wrapper/qwltouch_p.h b/src/compositor/wayland_wrapper/qwltouch_p.h index 403cc3b4e..febfb9303 100644 --- a/src/compositor/wayland_wrapper/qwltouch_p.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -42,6 +42,17 @@ #ifndef QTWAYLAND_QWLTOUCH_P_H #define QTWAYLAND_QWLTOUCH_P_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCore/QPoint> diff --git a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h index 2575a3d6b..3a7f2de20 100644 --- a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h +++ b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h @@ -41,6 +41,17 @@ #ifndef WAYLANDWINDOWMANAGERINTEGRATION_H #define WAYLANDWINDOWMANAGERINTEGRATION_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + #include <QtCompositor/qwaylandexport.h> #include <QtCompositor/private/qwayland-server-windowmanager.h> diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 2c3697bd8..efed808fb 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -149,6 +149,13 @@ QSurfaceFormat QWaylandEglWindow::format() const return m_format; } +void QWaylandEglWindow::setVisible(bool visible) +{ + QWaylandWindow::setVisible(visible); + if (!visible) + invalidateSurface(); +} + void QWaylandEglWindow::invalidateSurface() { if (m_eglSurface) { diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h index 60722d168..c6bb43445 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h @@ -66,6 +66,7 @@ public: void bindContentFBO(); void invalidateSurface() Q_DECL_OVERRIDE; + void setVisible(bool visible) Q_DECL_OVERRIDE; private: QWaylandEglClientBufferIntegration *m_clientBufferIntegration; diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp index 85215f14b..2d5a182c7 100644 --- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp +++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp @@ -151,12 +151,6 @@ void WaylandEglClientBufferIntegration::initializeHardware(QtWayland::Display *w return; } - d->gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES")); - if (!d->gl_egl_image_target_texture_2d) { - qWarning("QtCompositor: Failed to initialize EGL display. Could not find glEGLImageTargetTexture2DOES."); - return; - } - if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) { d->display_bound = d->egl_bind_wayland_display(d->egl_display, waylandDisplay->handle()); if (!d->display_bound) { @@ -175,11 +169,22 @@ void WaylandEglClientBufferIntegration::initializeHardware(QtWayland::Display *w void WaylandEglClientBufferIntegration::bindTextureToBuffer(struct ::wl_resource *buffer) { Q_D(WaylandEglClientBufferIntegration); + if (!d->valid) { qWarning("QtCompositor: bindTextureToBuffer() failed"); return; } + // Vivante drivers on the iMX6 don't resolve this function early enough for us, they seem to require the EGL/GLES setup to be further + // along than they are in initializeHardware(), so do the lookup here instead. + if (!d->gl_egl_image_target_texture_2d) + d->gl_egl_image_target_texture_2d = reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES")); + + if (!d->gl_egl_image_target_texture_2d) { + qWarning("QtCompositor: bindTextureToBuffer() failed. Could not find glEGLImageTargetTexture2DOES."); + return; + } + EGLImageKHR image = d->egl_create_image(d->egl_display, EGL_NO_CONTEXT, EGL_WAYLAND_BUFFER_WL, buffer, NULL); diff --git a/src/shared/qwaylandxkb.cpp b/src/shared/qwaylandxkb.cpp index c947902bd..16d713c05 100644 --- a/src/shared/qwaylandxkb.cpp +++ b/src/shared/qwaylandxkb.cpp @@ -135,6 +135,8 @@ static const uint32_t KeyTbl[] = { XKB_KEY_XF86Eject, Qt::Key_Eject, + XKB_KEY_XF86Phone, Qt::Key_ToggleCallHangup, + 0, 0 }; |