summaryrefslogtreecommitdiffstats
path: root/src/compositor
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor')
-rw-r--r--src/compositor/compositor_api/qwaylandquicksurface.cpp5
-rw-r--r--src/compositor/compositor_api/qwaylandsurface_p.h11
-rw-r--r--src/compositor/compositor_api/qwaylandsurfaceitem.cpp4
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegration_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlclientbufferintegrationplugin_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlhwintegration_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegration_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h11
-rw-r--r--src/compositor/hardware_integration/qwlserverbufferintegrationplugin_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevice_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwldatadevicemanager_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwldataoffer_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwldatasource_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwldisplay_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlextendedsurface_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlinputdevice_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlinputmethod_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlinputmethodcontext_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlinputpanel_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlinputpanelsurface_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlkeyboard.cpp59
-rw-r--r--src/compositor/wayland_wrapper/qwlkeyboard_p.h12
-rw-r--r--src/compositor/wayland_wrapper/qwllistener_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwloutput_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlpointer_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlqtkey_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlqttouch_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlregion_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlshellsurface_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlsubsurface_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlsurface.cpp8
-rw-r--r--src/compositor/wayland_wrapper/qwlsurface_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwltextinput_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwltextinputmanager_p.h11
-rw-r--r--src/compositor/wayland_wrapper/qwltouch_p.h11
-rw-r--r--src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h11
39 files changed, 435 insertions, 27 deletions
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>