Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/client/hardwareintegration/qwaylandclientbufferintegrationplugin_p.h src/client/hardwareintegration/qwaylandserverbufferintegrationplugin_p.h src/compositor/hardware_integration/qwaylandclientbufferintegrationplugin.h src/compositor/hardware_integration/qwaylandserverbufferintegrationplugin.h src/plugins/hardwareintegration/client/brcm-egl/main.cpp src/plugins/hardwareintegration/client/drm-egl-server/main.cpp src/plugins/hardwareintegration/client/wayland-egl/main.cpp src/plugins/hardwareintegration/client/xcomposite-egl/main.cpp src/plugins/hardwareintegration/client/xcomposite-glx/main.cpp src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp src/plugins/hardwareintegration/compositor/drm-egl-server/main.cpp src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp Change-Id: I9a9b418075970dd334babc3590b9b0315c2afb0d
This commit is contained in:
commit
ebe84dd5cc
@ -39,8 +39,8 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWaylandClient/qwaylandclientbufferintegrationplugin.h>
|
||||
#include "qwaylandbrcmeglclientbufferintegration.h"
|
||||
#include <QtWaylandClient/private/qwaylandclientbufferintegrationplugin_p.h>
|
||||
#include "qwaylandbrcmeglintegration.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -56,15 +56,15 @@ public:
|
||||
QStringList QWaylandBrcmEglClientBufferPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "brcm";
|
||||
list << "wayland-brcm";
|
||||
return list;
|
||||
}
|
||||
|
||||
QWaylandEglClientBufferIntegration *QWaylandBrcmEglClientBufferPlugin::create(const QString& system, const QStringList& paramList)
|
||||
QWaylandClientBufferIntegration *QWaylandBrcmEglClientBufferPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
if (system.toLower() == "brcm")
|
||||
return new QWaylandBrcmEglClientBufferIntegration();
|
||||
if (system.toLower() == "wayland-brcm")
|
||||
return new QWaylandBrcmEglIntegration();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -39,8 +39,8 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWaylandClient/qwaylandclientbufferintegrationplugin.h>
|
||||
#include "qwaylandxcompositeglxclientbufferintegration.h"
|
||||
#include <QtWaylandClient/private/qwaylandclientbufferintegrationplugin_p.h>
|
||||
#include "qwaylandxcompositeglxintegration.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -64,7 +64,7 @@ QWaylandClientBufferIntegration *QWaylandXCompositeGlxClientBufferIntegrationPlu
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
if (system.toLower() == "xcomposite-glx")
|
||||
return new QWaylandXCompositeGLXClientBufferIntegration();
|
||||
return new QWaylandXCompositeGLXIntegration();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -175,12 +175,6 @@ QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
|
||||
{
|
||||
Listener l = { listener, data };
|
||||
mRegistryListeners.append(l);
|
||||
}
|
||||
|
||||
void QWaylandDisplay::waitForScreens()
|
||||
{
|
||||
flushRequests();
|
||||
@ -234,13 +228,33 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
|
||||
} else if (interface == QStringLiteral("wl_text_input_manager")) {
|
||||
mTextInputManager.reset(new QtWayland::wl_text_input_manager(registry, id));
|
||||
} else if (interface == QStringLiteral("qt_hardware_integration")) {
|
||||
mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
|
||||
mHardwareIntegration.reset(new QWaylandHardwareIntegration(registry, id));
|
||||
}
|
||||
|
||||
mGlobals.append(RegistryGlobal(id, interface, version, registry));
|
||||
|
||||
foreach (Listener l, mRegistryListeners)
|
||||
(*l.listener)(l.data, registry, id, interface, version);
|
||||
}
|
||||
|
||||
void QWaylandDisplay::registry_global_remove(uint32_t id)
|
||||
{
|
||||
for (int i = 0, ie = mGlobals.count(); i != ie; ++i) {
|
||||
if (mGlobals[i].id == id) {
|
||||
mGlobals.removeAt(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
|
||||
{
|
||||
Listener l = { listener, data };
|
||||
mRegistryListeners.append(l);
|
||||
for (int i = 0, ie = mGlobals.count(); i != ie; ++i)
|
||||
(*l.listener)(l.data, mGlobals[i].registry, mGlobals[i].id, mGlobals[i].interface, mGlobals[i].version);
|
||||
}
|
||||
|
||||
uint32_t QWaylandDisplay::currentTimeMillisec()
|
||||
{
|
||||
//### we throw away the time information
|
||||
|
@ -130,6 +130,15 @@ public:
|
||||
QtWayland::wl_text_input_manager *textInputManager() const { return mTextInputManager.data(); }
|
||||
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); }
|
||||
|
||||
struct RegistryGlobal {
|
||||
uint32_t id;
|
||||
QString interface;
|
||||
uint32_t version;
|
||||
struct ::wl_registry *registry;
|
||||
RegistryGlobal(uint32_t id_, const QString &interface_, uint32_t version_, struct ::wl_registry *registry_)
|
||||
: id(id_), interface(interface_), version(version_), registry(registry_) { }
|
||||
};
|
||||
|
||||
/* wl_registry_add_listener does not add but rather sets a listener, so this function is used
|
||||
* to enable many listeners at once. */
|
||||
void addRegistryListener(RegistryListener listener, void *data);
|
||||
@ -173,13 +182,14 @@ private:
|
||||
QScopedPointer<QWaylandWindowManagerIntegration> mWindowManagerIntegration;
|
||||
QScopedPointer<QtWayland::wl_text_input_manager> mTextInputManager;
|
||||
QScopedPointer<QWaylandHardwareIntegration> mHardwareIntegration;
|
||||
|
||||
QSocketNotifier *mReadNotifier;
|
||||
int mFd;
|
||||
int mWritableNotificationFd;
|
||||
bool mScreensInitialized;
|
||||
QList<RegistryGlobal> mGlobals;
|
||||
|
||||
void registry_global(uint32_t id, const QString &interface, uint32_t version) Q_DECL_OVERRIDE;
|
||||
void registry_global_remove(uint32_t id) Q_DECL_OVERRIDE;
|
||||
|
||||
static void shellHandleConfigure(void *data, struct wl_shell *shell,
|
||||
uint32_t time, uint32_t edges,
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
if (mXkbContext)
|
||||
xkb_context_unref(mXkbContext);
|
||||
#endif
|
||||
wl_keyboard_destroy(object());
|
||||
}
|
||||
|
||||
void keyboard_keymap(uint32_t format,
|
||||
@ -161,6 +162,7 @@ public:
|
||||
}
|
||||
~Pointer()
|
||||
{
|
||||
wl_pointer_destroy(object());
|
||||
}
|
||||
|
||||
void pointer_enter(uint32_t serial, struct wl_surface *surface,
|
||||
@ -193,6 +195,7 @@ public:
|
||||
}
|
||||
~Touch()
|
||||
{
|
||||
wl_touch_destroy(object());
|
||||
}
|
||||
|
||||
void touch_down(uint32_t serial,
|
||||
@ -229,6 +232,7 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, uint32_t id)
|
||||
, mTouch(0)
|
||||
, mTime(0)
|
||||
, mSerial(0)
|
||||
, mTouchDevice(0)
|
||||
{
|
||||
if (mQDisplay->dndSelectionHandler()) {
|
||||
mDataDevice = mQDisplay->dndSelectionHandler()->getDataDevice(this);
|
||||
@ -733,17 +737,20 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
|
||||
{
|
||||
Q_UNUSED(serial);
|
||||
QWaylandWindow *window = mFocus;
|
||||
uint32_t code = key + 8;
|
||||
bool isDown = state != 0;
|
||||
QEvent::Type type = isDown ? QEvent::KeyPress : QEvent::KeyRelease;
|
||||
QString text;
|
||||
int qtkey = key + 8; // qt-compositor substracts 8 for some reason
|
||||
|
||||
#ifndef QT_NO_WAYLAND_XKB
|
||||
if (!mXkbMap)
|
||||
return;
|
||||
|
||||
uint32_t code = key + 8;
|
||||
bool isDown = state != 0;
|
||||
const xkb_keysym_t *syms;
|
||||
uint32_t numSyms = xkb_key_get_syms(mXkbState, code, &syms);
|
||||
xkb_state_update_key(mXkbState, code,
|
||||
isDown ? XKB_KEY_DOWN : XKB_KEY_UP);
|
||||
QEvent::Type type = isDown ? QEvent::KeyPress : QEvent::KeyRelease;
|
||||
|
||||
if (!window) {
|
||||
// We destroyed the keyboard focus surface, but the server
|
||||
@ -751,9 +758,6 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
|
||||
return;
|
||||
}
|
||||
|
||||
int qtkey = key + 8; // qt-compositor substracts 8 for some reason
|
||||
QString text;
|
||||
|
||||
if (numSyms == 1) {
|
||||
xkb_keysym_t sym = syms[0];
|
||||
Qt::KeyboardModifiers modifiers = mParent->modifiers();
|
||||
|
@ -285,7 +285,7 @@ void QWaylandIntegration::initializeClientBufferIntegration()
|
||||
if (mClientBufferIntegration)
|
||||
mClientBufferIntegration->initialize(mDisplay);
|
||||
else
|
||||
qWarning("Failed to load client buffer intgration: %s\n", qPrintable(targetKey));
|
||||
qWarning("Failed to load client buffer integration: %s\n", qPrintable(targetKey));
|
||||
}
|
||||
|
||||
void QWaylandIntegration::initializeServerBufferIntegration()
|
||||
@ -304,7 +304,7 @@ void QWaylandIntegration::initializeServerBufferIntegration()
|
||||
}
|
||||
|
||||
if (targetKey.isEmpty()) {
|
||||
qWarning("Failed to determin what server buffer integration to use");
|
||||
qWarning("Failed to determine what server buffer integration to use");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,8 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
|
||||
, mFrameCallback(0)
|
||||
, mRequestResizeSent(false)
|
||||
, mCanResize(true)
|
||||
, mResizeDirty(false)
|
||||
, mResizeAfterSwap(!qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
|
||||
, mSentInitialResize(false)
|
||||
, mMouseDevice(0)
|
||||
, mMouseSerial(0)
|
||||
@ -119,7 +121,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
|
||||
|
||||
setWindowFlags(window->flags());
|
||||
setGeometry(window->geometry());
|
||||
setWindowState(window->windowState());
|
||||
setWindowStateInternal(window->windowState());
|
||||
}
|
||||
|
||||
QWaylandWindow::~QWaylandWindow()
|
||||
@ -195,18 +197,16 @@ void QWaylandWindow::setGeometry(const QRect &rect)
|
||||
if (mWindowDecoration && window()->isVisible())
|
||||
mWindowDecoration->update();
|
||||
|
||||
if (mConfigure.isEmpty()) {
|
||||
if (mResizeAfterSwap)
|
||||
mResizeDirty = true;
|
||||
else
|
||||
QWindowSystemInterface::handleGeometryChange(window(), geometry());
|
||||
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
|
||||
}
|
||||
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
|
||||
}
|
||||
|
||||
void QWaylandWindow::setVisible(bool visible)
|
||||
{
|
||||
if (visible) {
|
||||
if (mBuffer)
|
||||
attach(mBuffer->buffer(), 0, 0);
|
||||
|
||||
if (window()->type() == Qt::Popup && transientParent()) {
|
||||
QWaylandWindow *parent = transientParent();
|
||||
mMouseDevice = parent->mMouseDevice;
|
||||
@ -227,10 +227,10 @@ void QWaylandWindow::setVisible(bool visible)
|
||||
// QWaylandShmBackingStore::beginPaint().
|
||||
} else {
|
||||
QWindowSystemInterface::handleExposeEvent(window(), QRegion());
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
attach(static_cast<QWaylandBuffer *>(0), 0, 0);
|
||||
commit();
|
||||
}
|
||||
damage(QRect(QPoint(0,0),geometry().size()));
|
||||
commit();
|
||||
}
|
||||
|
||||
|
||||
@ -287,7 +287,6 @@ void QWaylandWindow::doResize()
|
||||
setGeometry(geometry);
|
||||
|
||||
mConfigure.clear();
|
||||
QWindowSystemInterface::handleGeometryChange(window(), geometry);
|
||||
}
|
||||
|
||||
void QWaylandWindow::setCanResize(bool canResize)
|
||||
@ -295,9 +294,17 @@ void QWaylandWindow::setCanResize(bool canResize)
|
||||
QMutexLocker lock(&mResizeLock);
|
||||
mCanResize = canResize;
|
||||
|
||||
if (canResize && !mConfigure.isEmpty()) {
|
||||
doResize();
|
||||
QWindowSystemInterface::handleExposeEvent(window(), geometry());
|
||||
if (canResize) {
|
||||
if (mResizeDirty) {
|
||||
QWindowSystemInterface::handleGeometryChange(window(), geometry());
|
||||
}
|
||||
if (!mConfigure.isEmpty()) {
|
||||
doResize();
|
||||
QWindowSystemInterface::handleExposeEvent(window(), geometry());
|
||||
} else if (mResizeDirty) {
|
||||
QWindowSystemInterface::handleExposeEvent(window(), geometry());
|
||||
mResizeDirty = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,31 +416,8 @@ void QWaylandWindow::handleContentOrientationChange(Qt::ScreenOrientation orient
|
||||
|
||||
void QWaylandWindow::setWindowState(Qt::WindowState state)
|
||||
{
|
||||
if (mState == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
// As of february 2013 QWindow::setWindowState sets the new state value after
|
||||
// QPlatformWindow::setWindowState returns, so we cannot rely on QWindow::windowState
|
||||
// here. We use then this mState variable.
|
||||
mState = state;
|
||||
createDecoration();
|
||||
switch (state) {
|
||||
case Qt::WindowFullScreen:
|
||||
mShellSurface->setFullscreen();
|
||||
break;
|
||||
case Qt::WindowMaximized:
|
||||
mShellSurface->setMaximized();
|
||||
break;
|
||||
case Qt::WindowMinimized:
|
||||
mShellSurface->setMinimized();
|
||||
break;
|
||||
default:
|
||||
mShellSurface->setNormal();
|
||||
}
|
||||
|
||||
QWindowSystemInterface::handleWindowStateChanged(window(), mState);
|
||||
QWindowSystemInterface::flushWindowSystemEvents(); // Required for oldState to work on WindowStateChanged
|
||||
if (setWindowStateInternal(state))
|
||||
QWindowSystemInterface::flushWindowSystemEvents(); // Required for oldState to work on WindowStateChanged
|
||||
}
|
||||
|
||||
void QWaylandWindow::setWindowFlags(Qt::WindowFlags flags)
|
||||
@ -605,4 +589,33 @@ bool QWaylandWindow::setMouseGrabEnabled(bool grab)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QWaylandWindow::setWindowStateInternal(Qt::WindowState state)
|
||||
{
|
||||
if (mState == state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// As of february 2013 QWindow::setWindowState sets the new state value after
|
||||
// QPlatformWindow::setWindowState returns, so we cannot rely on QWindow::windowState
|
||||
// here. We use then this mState variable.
|
||||
mState = state;
|
||||
createDecoration();
|
||||
switch (state) {
|
||||
case Qt::WindowFullScreen:
|
||||
mShellSurface->setFullscreen();
|
||||
break;
|
||||
case Qt::WindowMaximized:
|
||||
mShellSurface->setMaximized();
|
||||
break;
|
||||
case Qt::WindowMinimized:
|
||||
mShellSurface->setMinimized();
|
||||
break;
|
||||
default:
|
||||
mShellSurface->setNormal();
|
||||
}
|
||||
|
||||
QWindowSystemInterface::handleWindowStateChanged(window(), mState);
|
||||
return true;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -193,6 +193,8 @@ protected:
|
||||
QWaylandWindowConfigure mConfigure;
|
||||
bool mRequestResizeSent;
|
||||
bool mCanResize;
|
||||
bool mResizeDirty;
|
||||
bool mResizeAfterSwap;
|
||||
|
||||
bool mSentInitialResize;
|
||||
QPoint mOffset;
|
||||
@ -204,6 +206,8 @@ protected:
|
||||
Qt::WindowState mState;
|
||||
|
||||
private:
|
||||
bool setWindowStateInternal(Qt::WindowState flags);
|
||||
|
||||
void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice,
|
||||
ulong timestamp,
|
||||
const QPointF & local,
|
||||
|
Loading…
x
Reference in New Issue
Block a user