Merge remote-tracking branch 'origin/5.8' into dev
Change-Id: Ic2135c6ff27ca3fdef6a76dbdc72f73f5ca4d7fb
This commit is contained in:
commit
192c88eae3
@ -2,13 +2,18 @@ TARGET = QtWaylandClient
|
|||||||
MODULE = waylandclient
|
MODULE = waylandclient
|
||||||
|
|
||||||
QT += core-private gui-private
|
QT += core-private gui-private
|
||||||
QT_FOR_PRIVATE += platformsupport-private
|
QT_FOR_PRIVATE += service_support-private
|
||||||
|
QT_PRIVATE += fontdatabase_support-private eventdispatcher_support-private theme_support-private
|
||||||
|
|
||||||
# We have a bunch of C code with casts, so we can't have this option
|
# We have a bunch of C code with casts, so we can't have this option
|
||||||
QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
|
QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
|
||||||
|
|
||||||
|
# Prevent gold linker from crashing.
|
||||||
|
# This started happening when QtPlatformSupport was modularized.
|
||||||
|
use_gold_linker: CONFIG += no_linker_version_script
|
||||||
|
|
||||||
CONFIG -= precompile_header
|
CONFIG -= precompile_header
|
||||||
CONFIG += link_pkgconfig qpa/genericunixfontdatabase wayland-scanner
|
CONFIG += link_pkgconfig wayland-scanner
|
||||||
|
|
||||||
contains(QT_CONFIG, opengl) {
|
contains(QT_CONFIG, opengl) {
|
||||||
DEFINES += QT_WAYLAND_GL_SUPPORT
|
DEFINES += QT_WAYLAND_GL_SUPPORT
|
||||||
|
@ -183,7 +183,8 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface,
|
|||||||
|
|
||||||
void QWaylandDataDevice::data_device_leave()
|
void QWaylandDataDevice::data_device_leave()
|
||||||
{
|
{
|
||||||
QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction);
|
if (m_dragWindow)
|
||||||
|
QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction);
|
||||||
|
|
||||||
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
|
QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag();
|
||||||
if (!drag) {
|
if (!drag) {
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QPointer>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||||
@ -106,7 +107,7 @@ private:
|
|||||||
QWaylandDisplay *m_display;
|
QWaylandDisplay *m_display;
|
||||||
QWaylandInputDevice *m_inputDevice;
|
QWaylandInputDevice *m_inputDevice;
|
||||||
uint32_t m_enterSerial;
|
uint32_t m_enterSerial;
|
||||||
QWindow *m_dragWindow;
|
QPointer<QWindow> m_dragWindow;
|
||||||
QPoint m_dragPoint;
|
QPoint m_dragPoint;
|
||||||
QScopedPointer<QWaylandDataOffer> m_dragOffer;
|
QScopedPointer<QWaylandDataOffer> m_dragOffer;
|
||||||
QScopedPointer<QWaylandDataOffer> m_selectionOffer;
|
QScopedPointer<QWaylandDataOffer> m_selectionOffer;
|
||||||
|
@ -422,6 +422,12 @@ void QWaylandDisplay::handleKeyboardFocusChanged(QWaylandInputDevice *inputDevic
|
|||||||
mLastKeyboardFocus = keyboardFocus;
|
mLastKeyboardFocus = keyboardFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QWaylandDisplay::handleWindowDestroyed(QWaylandWindow *window)
|
||||||
|
{
|
||||||
|
if (mActiveWindows.contains(window))
|
||||||
|
handleWindowDeactivated(window);
|
||||||
|
}
|
||||||
|
|
||||||
void QWaylandDisplay::handleWaylandSync()
|
void QWaylandDisplay::handleWaylandSync()
|
||||||
{
|
{
|
||||||
// This callback is used to set the window activation because we may get an activate/deactivate
|
// This callback is used to set the window activation because we may get an activate/deactivate
|
||||||
|
@ -176,6 +176,7 @@ public:
|
|||||||
void handleWindowActivated(QWaylandWindow *window);
|
void handleWindowActivated(QWaylandWindow *window);
|
||||||
void handleWindowDeactivated(QWaylandWindow *window);
|
void handleWindowDeactivated(QWaylandWindow *window);
|
||||||
void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice);
|
void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice);
|
||||||
|
void handleWindowDestroyed(QWaylandWindow *window);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void blockingReadEvents();
|
void blockingReadEvents();
|
||||||
@ -217,7 +218,7 @@ private:
|
|||||||
uint32_t mLastInputSerial;
|
uint32_t mLastInputSerial;
|
||||||
QWaylandInputDevice *mLastInputDevice;
|
QWaylandInputDevice *mLastInputDevice;
|
||||||
QPointer<QWaylandWindow> mLastInputWindow;
|
QPointer<QWaylandWindow> mLastInputWindow;
|
||||||
QWaylandWindow *mLastKeyboardFocus;
|
QPointer<QWaylandWindow> mLastKeyboardFocus;
|
||||||
QVector<QWaylandWindow *> mActiveWindows;
|
QVector<QWaylandWindow *> mActiveWindows;
|
||||||
struct wl_callback *mSyncCallback;
|
struct wl_callback *mSyncCallback;
|
||||||
static const wl_callback_listener syncCallbackListener;
|
static const wl_callback_listener syncCallbackListener;
|
||||||
|
@ -50,9 +50,9 @@
|
|||||||
#include "qwaylandwindowmanagerintegration_p.h"
|
#include "qwaylandwindowmanagerintegration_p.h"
|
||||||
#include "qwaylandscreen_p.h"
|
#include "qwaylandscreen_p.h"
|
||||||
|
|
||||||
#include "QtPlatformSupport/private/qgenericunixfontdatabase_p.h"
|
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
|
||||||
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
|
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
#include <QtPlatformSupport/private/qgenericunixthemes_p.h>
|
#include <QtThemeSupport/private/qgenericunixthemes_p.h>
|
||||||
|
|
||||||
#include <QtGui/private/qguiapplication_p.h>
|
#include <QtGui/private/qguiapplication_p.h>
|
||||||
|
|
||||||
@ -119,7 +119,6 @@ public:
|
|||||||
|
|
||||||
QWaylandIntegration::QWaylandIntegration()
|
QWaylandIntegration::QWaylandIntegration()
|
||||||
: mClientBufferIntegration(0)
|
: mClientBufferIntegration(0)
|
||||||
, mShellIntegration(Q_NULLPTR)
|
|
||||||
, mInputDeviceIntegration(Q_NULLPTR)
|
, mInputDeviceIntegration(Q_NULLPTR)
|
||||||
, mFontDb(new QGenericUnixFontDatabase())
|
, mFontDb(new QGenericUnixFontDatabase())
|
||||||
, mNativeInterface(new QWaylandNativeInterface(this))
|
, mNativeInterface(new QWaylandNativeInterface(this))
|
||||||
@ -131,16 +130,16 @@ QWaylandIntegration::QWaylandIntegration()
|
|||||||
, mShellIntegrationInitialized(false)
|
, mShellIntegrationInitialized(false)
|
||||||
{
|
{
|
||||||
initializeInputDeviceIntegration();
|
initializeInputDeviceIntegration();
|
||||||
mDisplay = new QWaylandDisplay(this);
|
mDisplay.reset(new QWaylandDisplay(this));
|
||||||
mClipboard = new QWaylandClipboard(mDisplay);
|
mClipboard.reset(new QWaylandClipboard(mDisplay.data()));
|
||||||
mDrag = new QWaylandDrag(mDisplay);
|
mDrag.reset(new QWaylandDrag(mDisplay.data()));
|
||||||
|
|
||||||
QString icStr = QPlatformInputContextFactory::requested();
|
QString icStr = QPlatformInputContextFactory::requested();
|
||||||
if (!icStr.isNull()) {
|
if (!icStr.isNull()) {
|
||||||
mInputContext.reset(QPlatformInputContextFactory::create(icStr));
|
mInputContext.reset(QPlatformInputContextFactory::create(icStr));
|
||||||
} else {
|
} else {
|
||||||
//try to use the input context using the wl_text_input interface
|
//try to use the input context using the wl_text_input interface
|
||||||
QPlatformInputContext *ctx = new QWaylandInputContext(mDisplay);
|
QPlatformInputContext *ctx = new QWaylandInputContext(mDisplay.data());
|
||||||
mInputContext.reset(ctx);
|
mInputContext.reset(ctx);
|
||||||
|
|
||||||
//use the traditional way for on screen keyboards for now
|
//use the traditional way for on screen keyboards for now
|
||||||
@ -153,18 +152,11 @@ QWaylandIntegration::QWaylandIntegration()
|
|||||||
|
|
||||||
QWaylandIntegration::~QWaylandIntegration()
|
QWaylandIntegration::~QWaylandIntegration()
|
||||||
{
|
{
|
||||||
delete mDrag;
|
|
||||||
delete mClipboard;
|
|
||||||
#ifndef QT_NO_ACCESSIBILITY
|
|
||||||
delete mAccessibility;
|
|
||||||
#endif
|
|
||||||
delete mNativeInterface;
|
|
||||||
delete mDisplay;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
|
QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
|
||||||
{
|
{
|
||||||
return mNativeInterface;
|
return mNativeInterface.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||||
@ -217,27 +209,27 @@ QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
|
|||||||
void QWaylandIntegration::initialize()
|
void QWaylandIntegration::initialize()
|
||||||
{
|
{
|
||||||
QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
|
QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
|
||||||
QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay, SLOT(flushRequests()));
|
QObject::connect(dispatcher, SIGNAL(aboutToBlock()), mDisplay.data(), SLOT(flushRequests()));
|
||||||
QObject::connect(dispatcher, SIGNAL(awake()), mDisplay, SLOT(flushRequests()));
|
QObject::connect(dispatcher, SIGNAL(awake()), mDisplay.data(), SLOT(flushRequests()));
|
||||||
|
|
||||||
int fd = wl_display_get_fd(mDisplay->wl_display());
|
int fd = wl_display_get_fd(mDisplay->wl_display());
|
||||||
QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay);
|
QSocketNotifier *sn = new QSocketNotifier(fd, QSocketNotifier::Read, mDisplay.data());
|
||||||
QObject::connect(sn, SIGNAL(activated(int)), mDisplay, SLOT(flushRequests()));
|
QObject::connect(sn, SIGNAL(activated(int)), mDisplay.data(), SLOT(flushRequests()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
|
QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
|
||||||
{
|
{
|
||||||
return mFontDb;
|
return mFontDb.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformClipboard *QWaylandIntegration::clipboard() const
|
QPlatformClipboard *QWaylandIntegration::clipboard() const
|
||||||
{
|
{
|
||||||
return mClipboard;
|
return mClipboard.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformDrag *QWaylandIntegration::drag() const
|
QPlatformDrag *QWaylandIntegration::drag() const
|
||||||
{
|
{
|
||||||
return mDrag;
|
return mDrag.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QPlatformInputContext *QWaylandIntegration::inputContext() const
|
QPlatformInputContext *QWaylandIntegration::inputContext() const
|
||||||
@ -263,7 +255,7 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const
|
|||||||
#ifndef QT_NO_ACCESSIBILITY
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
QPlatformAccessibility *QWaylandIntegration::accessibility() const
|
QPlatformAccessibility *QWaylandIntegration::accessibility() const
|
||||||
{
|
{
|
||||||
return mAccessibility;
|
return mAccessibility.data();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -274,7 +266,7 @@ QPlatformServices *QWaylandIntegration::services() const
|
|||||||
|
|
||||||
QWaylandDisplay *QWaylandIntegration::display() const
|
QWaylandDisplay *QWaylandIntegration::display() const
|
||||||
{
|
{
|
||||||
return mDisplay;
|
return mDisplay.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QWaylandIntegration::themeNames() const
|
QStringList QWaylandIntegration::themeNames() const
|
||||||
@ -292,7 +284,7 @@ QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration()
|
|||||||
if (!mClientBufferIntegrationInitialized)
|
if (!mClientBufferIntegrationInitialized)
|
||||||
const_cast<QWaylandIntegration *>(this)->initializeClientBufferIntegration();
|
const_cast<QWaylandIntegration *>(this)->initializeClientBufferIntegration();
|
||||||
|
|
||||||
return mClientBufferIntegration && mClientBufferIntegration->isValid() ? mClientBufferIntegration : 0;
|
return mClientBufferIntegration && mClientBufferIntegration->isValid() ? mClientBufferIntegration.data() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration() const
|
QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration() const
|
||||||
@ -300,7 +292,7 @@ QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration()
|
|||||||
if (!mServerBufferIntegrationInitialized)
|
if (!mServerBufferIntegrationInitialized)
|
||||||
const_cast<QWaylandIntegration *>(this)->initializeServerBufferIntegration();
|
const_cast<QWaylandIntegration *>(this)->initializeServerBufferIntegration();
|
||||||
|
|
||||||
return mServerBufferIntegration;
|
return mServerBufferIntegration.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
|
QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
|
||||||
@ -308,7 +300,7 @@ QWaylandShellIntegration *QWaylandIntegration::shellIntegration() const
|
|||||||
if (!mShellIntegrationInitialized)
|
if (!mShellIntegrationInitialized)
|
||||||
const_cast<QWaylandIntegration *>(this)->initializeShellIntegration();
|
const_cast<QWaylandIntegration *>(this)->initializeShellIntegration();
|
||||||
|
|
||||||
return mShellIntegration;
|
return mShellIntegration.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandIntegration::initializeClientBufferIntegration()
|
void QWaylandIntegration::initializeClientBufferIntegration()
|
||||||
@ -334,10 +326,10 @@ void QWaylandIntegration::initializeClientBufferIntegration()
|
|||||||
|
|
||||||
QStringList keys = QWaylandClientBufferIntegrationFactory::keys();
|
QStringList keys = QWaylandClientBufferIntegrationFactory::keys();
|
||||||
if (keys.contains(targetKey)) {
|
if (keys.contains(targetKey)) {
|
||||||
mClientBufferIntegration = QWaylandClientBufferIntegrationFactory::create(targetKey, QStringList());
|
mClientBufferIntegration.reset(QWaylandClientBufferIntegrationFactory::create(targetKey, QStringList()));
|
||||||
}
|
}
|
||||||
if (mClientBufferIntegration)
|
if (mClientBufferIntegration)
|
||||||
mClientBufferIntegration->initialize(mDisplay);
|
mClientBufferIntegration->initialize(mDisplay.data());
|
||||||
else
|
else
|
||||||
qWarning("Failed to load client buffer integration: %s\n", qPrintable(targetKey));
|
qWarning("Failed to load client buffer integration: %s\n", qPrintable(targetKey));
|
||||||
}
|
}
|
||||||
@ -364,10 +356,10 @@ void QWaylandIntegration::initializeServerBufferIntegration()
|
|||||||
|
|
||||||
QStringList keys = QWaylandServerBufferIntegrationFactory::keys();
|
QStringList keys = QWaylandServerBufferIntegrationFactory::keys();
|
||||||
if (keys.contains(targetKey)) {
|
if (keys.contains(targetKey)) {
|
||||||
mServerBufferIntegration = QWaylandServerBufferIntegrationFactory::create(targetKey, QStringList());
|
mServerBufferIntegration.reset(QWaylandServerBufferIntegrationFactory::create(targetKey, QStringList()));
|
||||||
}
|
}
|
||||||
if (mServerBufferIntegration)
|
if (mServerBufferIntegration)
|
||||||
mServerBufferIntegration->initialize(mDisplay);
|
mServerBufferIntegration->initialize(mDisplay.data());
|
||||||
else
|
else
|
||||||
qWarning("Failed to load server buffer integration %s\n", qPrintable(targetKey));
|
qWarning("Failed to load server buffer integration %s\n", qPrintable(targetKey));
|
||||||
}
|
}
|
||||||
@ -383,7 +375,7 @@ void QWaylandIntegration::initializeShellIntegration()
|
|||||||
QStringList keys = QWaylandShellIntegrationFactory::keys();
|
QStringList keys = QWaylandShellIntegrationFactory::keys();
|
||||||
if (keys.contains(targetKey)) {
|
if (keys.contains(targetKey)) {
|
||||||
qDebug("Using the '%s' shell integration", qPrintable(targetKey));
|
qDebug("Using the '%s' shell integration", qPrintable(targetKey));
|
||||||
mShellIntegration = QWaylandShellIntegrationFactory::create(targetKey, QStringList());
|
mShellIntegration.reset(QWaylandShellIntegrationFactory::create(targetKey, QStringList()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QStringList preferredShells;
|
QStringList preferredShells;
|
||||||
@ -393,15 +385,14 @@ void QWaylandIntegration::initializeShellIntegration()
|
|||||||
|
|
||||||
Q_FOREACH (QString preferredShell, preferredShells) {
|
Q_FOREACH (QString preferredShell, preferredShells) {
|
||||||
if (mDisplay->hasRegistryGlobal(preferredShell)) {
|
if (mDisplay->hasRegistryGlobal(preferredShell)) {
|
||||||
mShellIntegration = createShellIntegration(preferredShell);
|
mShellIntegration.reset(createShellIntegration(preferredShell));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mShellIntegration || !mShellIntegration->initialize(mDisplay)) {
|
if (!mShellIntegration || !mShellIntegration->initialize(mDisplay.data())) {
|
||||||
delete mShellIntegration;
|
mShellIntegration.reset();
|
||||||
mShellIntegration = Q_NULLPTR;
|
|
||||||
qWarning("Failed to load shell integration %s", qPrintable(targetKey));
|
qWarning("Failed to load shell integration %s", qPrintable(targetKey));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -425,7 +416,7 @@ void QWaylandIntegration::initializeInputDeviceIntegration()
|
|||||||
|
|
||||||
QStringList keys = QWaylandInputDeviceIntegrationFactory::keys();
|
QStringList keys = QWaylandInputDeviceIntegrationFactory::keys();
|
||||||
if (keys.contains(targetKey)) {
|
if (keys.contains(targetKey)) {
|
||||||
mInputDeviceIntegration = QWaylandInputDeviceIntegrationFactory::create(targetKey, QStringList());
|
mInputDeviceIntegration.reset(QWaylandInputDeviceIntegrationFactory::create(targetKey, QStringList()));
|
||||||
qDebug("Using the '%s' input device integration", qPrintable(targetKey));
|
qDebug("Using the '%s' input device integration", qPrintable(targetKey));
|
||||||
} else {
|
} else {
|
||||||
qWarning("Wayland inputdevice integration '%s' not found, using default", qPrintable(targetKey));
|
qWarning("Wayland inputdevice integration '%s' not found, using default", qPrintable(targetKey));
|
||||||
@ -435,9 +426,9 @@ void QWaylandIntegration::initializeInputDeviceIntegration()
|
|||||||
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &interfaceName)
|
QWaylandShellIntegration *QWaylandIntegration::createShellIntegration(const QString &interfaceName)
|
||||||
{
|
{
|
||||||
if (interfaceName == QLatin1Literal("wl_shell")) {
|
if (interfaceName == QLatin1Literal("wl_shell")) {
|
||||||
return new QWaylandWlShellIntegration(mDisplay);
|
return new QWaylandWlShellIntegration(mDisplay.data());
|
||||||
} else if (interfaceName == QLatin1Literal("xdg_shell")) {
|
} else if (interfaceName == QLatin1Literal("xdg_shell")) {
|
||||||
return new QWaylandXdgShellIntegration(mDisplay);
|
return new QWaylandXdgShellIntegration(mDisplay.data());
|
||||||
} else {
|
} else {
|
||||||
return Q_NULLPTR;
|
return Q_NULLPTR;
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@
|
|||||||
#include <qpa/qplatformintegration.h>
|
#include <qpa/qplatformintegration.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/qwaylandclientexport.h>
|
#include <QtWaylandClient/qwaylandclientexport.h>
|
||||||
|
#include <QtCore/QScopedPointer>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
@ -113,10 +115,10 @@ public:
|
|||||||
virtual QWaylandShellIntegration *shellIntegration() const;
|
virtual QWaylandShellIntegration *shellIntegration() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWaylandClientBufferIntegration *mClientBufferIntegration;
|
QScopedPointer<QWaylandClientBufferIntegration> mClientBufferIntegration;
|
||||||
QWaylandServerBufferIntegration *mServerBufferIntegration;
|
QScopedPointer<QWaylandServerBufferIntegration> mServerBufferIntegration;
|
||||||
QWaylandShellIntegration *mShellIntegration;
|
QScopedPointer<QWaylandShellIntegration> mShellIntegration;
|
||||||
QWaylandInputDeviceIntegration *mInputDeviceIntegration;
|
QScopedPointer<QWaylandInputDeviceIntegration> mInputDeviceIntegration;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initializeClientBufferIntegration();
|
void initializeClientBufferIntegration();
|
||||||
@ -125,14 +127,14 @@ private:
|
|||||||
void initializeInputDeviceIntegration();
|
void initializeInputDeviceIntegration();
|
||||||
QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
|
QWaylandShellIntegration *createShellIntegration(const QString& interfaceName);
|
||||||
|
|
||||||
QPlatformFontDatabase *mFontDb;
|
QScopedPointer<QPlatformFontDatabase> mFontDb;
|
||||||
QPlatformClipboard *mClipboard;
|
QScopedPointer<QPlatformClipboard> mClipboard;
|
||||||
QPlatformDrag *mDrag;
|
QScopedPointer<QPlatformDrag> mDrag;
|
||||||
QWaylandDisplay *mDisplay;
|
QScopedPointer<QWaylandDisplay> mDisplay;
|
||||||
QPlatformNativeInterface *mNativeInterface;
|
QScopedPointer<QPlatformNativeInterface> mNativeInterface;
|
||||||
QScopedPointer<QPlatformInputContext> mInputContext;
|
QScopedPointer<QPlatformInputContext> mInputContext;
|
||||||
#ifndef QT_NO_ACCESSIBILITY
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
QPlatformAccessibility *mAccessibility;
|
QScopedPointer<QPlatformAccessibility> mAccessibility;
|
||||||
#endif
|
#endif
|
||||||
bool mClientBufferIntegrationInitialized;
|
bool mClientBufferIntegrationInitialized;
|
||||||
bool mServerBufferIntegrationInitialized;
|
bool mServerBufferIntegrationInitialized;
|
||||||
|
@ -102,6 +102,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
|
|||||||
|
|
||||||
QWaylandWindow::~QWaylandWindow()
|
QWaylandWindow::~QWaylandWindow()
|
||||||
{
|
{
|
||||||
|
mDisplay->handleWindowDestroyed(this);
|
||||||
|
|
||||||
delete mWindowDecoration;
|
delete mWindowDecoration;
|
||||||
|
|
||||||
if (isInitialized())
|
if (isInitialized())
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
#include <QtCore/QScopedPointer>
|
#include <QtCore/QScopedPointer>
|
||||||
|
|
||||||
#include <wayland-client.h>
|
#include <wayland-client.h>
|
||||||
#include <QtPlatformSupport/private/qgenericunixservices_p.h>
|
#include <QtServiceSupport/private/qgenericunixservices_p.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qwayland-qt-windowmanager.h>
|
#include <QtWaylandClient/private/qwayland-qt-windowmanager.h>
|
||||||
#include <QtWaylandClient/qwaylandclientexport.h>
|
#include <QtWaylandClient/qwaylandclientexport.h>
|
||||||
|
@ -362,10 +362,8 @@ void Compositor::addSurface(Surface *surface)
|
|||||||
void Compositor::removeSurface(Surface *surface)
|
void Compositor::removeSurface(Surface *surface)
|
||||||
{
|
{
|
||||||
m_surfaces.removeOne(surface);
|
m_surfaces.removeOne(surface);
|
||||||
if (m_keyboard->focus() == surface)
|
m_keyboard->handleSurfaceDestroyed(surface);
|
||||||
m_keyboard->setFocus(0);
|
m_pointer->handleSurfaceDestroyed(surface);
|
||||||
if (m_pointer->focus() == surface)
|
|
||||||
m_pointer->setFocus(0, QPoint());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -267,6 +267,14 @@ void Keyboard::setFocus(Surface *surface)
|
|||||||
m_focus = surface;
|
m_focus = surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Keyboard::handleSurfaceDestroyed(Surface *surface)
|
||||||
|
{
|
||||||
|
if (surface == m_focus) {
|
||||||
|
m_focusResource = nullptr;
|
||||||
|
m_focus = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Keyboard::sendKey(uint32_t key, uint32_t state)
|
void Keyboard::sendKey(uint32_t key, uint32_t state)
|
||||||
{
|
{
|
||||||
if (m_focusResource) {
|
if (m_focusResource) {
|
||||||
@ -314,6 +322,14 @@ void Pointer::setFocus(Surface *surface, const QPoint &pos)
|
|||||||
m_focus = surface;
|
m_focus = surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pointer::handleSurfaceDestroyed(Surface *surface)
|
||||||
|
{
|
||||||
|
if (m_focus == surface) {
|
||||||
|
m_focus = nullptr;
|
||||||
|
m_focusResource = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Pointer::sendMotion(const QPoint &pos)
|
void Pointer::sendMotion(const QPoint &pos)
|
||||||
{
|
{
|
||||||
if (m_focusResource)
|
if (m_focusResource)
|
||||||
|
@ -75,6 +75,7 @@ public:
|
|||||||
|
|
||||||
Surface *focus() const { return m_focus; }
|
Surface *focus() const { return m_focus; }
|
||||||
void setFocus(Surface *surface);
|
void setFocus(Surface *surface);
|
||||||
|
void handleSurfaceDestroyed(Surface *surface);
|
||||||
|
|
||||||
void sendKey(uint32_t key, uint32_t state);
|
void sendKey(uint32_t key, uint32_t state);
|
||||||
|
|
||||||
@ -97,6 +98,7 @@ public:
|
|||||||
Surface *focus() const { return m_focus; }
|
Surface *focus() const { return m_focus; }
|
||||||
|
|
||||||
void setFocus(Surface *surface, const QPoint &pos);
|
void setFocus(Surface *surface, const QPoint &pos);
|
||||||
|
void handleSurfaceDestroyed(Surface *surface);
|
||||||
void sendMotion(const QPoint &pos);
|
void sendMotion(const QPoint &pos);
|
||||||
void sendButton(uint32_t button, uint32_t state);
|
void sendButton(uint32_t button, uint32_t state);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user