Adapt to recent qtbase changes and update dependencies

- moving linuxaccessibility/xkbcommon/eglsupport/glxsupport to QtGui
 - event refactoring

Task-number: QTBUG-83255
Change-Id: Ic82ee6ef5652413781468edb58c601ee7dce2e3b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Friedemann Kleint 2020-07-02 14:42:45 +02:00 committed by Tor Arne Vestbø
parent 1d5d2b6670
commit 7544734a33
17 changed files with 101 additions and 64 deletions

View File

@ -56,6 +56,7 @@ qt_add_module(WaylandClient
LIBRARIES LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::GuiPrivate Qt::GuiPrivate
Qt::PlatformHeadersPrivate
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Core Qt::Core
Qt::Gui Qt::Gui
@ -87,18 +88,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## Scopes: ## Scopes:
##################################################################### #####################################################################
qt_extend_target(WaylandClient CONDITION QT_FEATURE_xkbcommon
LIBRARIES
Qt::XkbCommonSupportPrivate
PRIVATE_MODULE_INTERFACE
Qt::XkbCommonSupportPrivate
)
qt_extend_target(WaylandClient CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate
LIBRARIES
Qt::LinuxAccessibilitySupportPrivate
)
qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard
SOURCES SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -56,6 +56,7 @@ qt_add_module(WaylandClient
LIBRARIES LIBRARIES
Qt::CorePrivate Qt::CorePrivate
Qt::GuiPrivate Qt::GuiPrivate
Qt::PlatformHeadersPrivate
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
Qt::Core Qt::Core
Qt::Gui Qt::Gui
@ -87,18 +88,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## Scopes: ## Scopes:
##################################################################### #####################################################################
qt_extend_target(WaylandClient CONDITION QT_FEATURE_xkbcommon
LIBRARIES
Qt::XkbCommonSupportPrivate
PRIVATE_MODULE_INTERFACE
Qt::XkbCommonSupportPrivate
)
qt_extend_target(WaylandClient CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate
LIBRARIES
Qt::LinuxAccessibilitySupportPrivate
)
qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard
SOURCES SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -3,6 +3,8 @@ MODULE = waylandclient
QT += core-private gui-private QT += core-private gui-private
QT_PRIVATE += platformheaders-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
@ -13,13 +15,6 @@ use_gold_linker: CONFIG += no_linker_version_script
CONFIG -= precompile_header CONFIG -= precompile_header
CONFIG += link_pkgconfig wayland-scanner CONFIG += link_pkgconfig wayland-scanner
qtConfig(xkbcommon) {
QT_FOR_PRIVATE += xkbcommon_support-private
}
qtHaveModule(linuxaccessibility_support-private): \
QT_PRIVATE += linuxaccessibility_support-private
QMAKE_USE += wayland-client QMAKE_USE += wayland-client
INCLUDEPATH += $$PWD/../shared INCLUDEPATH += $$PWD/../shared

View File

@ -18,7 +18,6 @@ qt_internal_add_plugin(QWaylandBrcmEglClientBufferPlugin
${CMAKE_DL_LIBS} ${CMAKE_DL_LIBS}
EGL::EGL EGL::EGL
Qt::Core Qt::Core
Qt::EglSupportPrivate
Qt::Gui Qt::Gui
Qt::WaylandClientPrivate Qt::WaylandClientPrivate
Wayland::Client Wayland::Client

View File

@ -0,0 +1,30 @@
# Generated from wayland-egl.pro.
#####################################################################
## QWaylandEglClientBufferPlugin Plugin:
#####################################################################
qt_internal_add_plugin(QWaylandEglClientBufferPlugin
OUTPUT_NAME qt-plugin-wayland-egl
TYPE wayland-graphics-integration-client
SOURCES
../../../../hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp ../../../../hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h
../../../../hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
../../../../hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp ../../../../hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
../../../../hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp ../../../../hardwareintegration/client/wayland-egl/qwaylandglcontext.h
main.cpp
INCLUDE_DIRECTORIES
../../../../hardwareintegration/client/wayland-egl
PUBLIC_LIBRARIES
${CMAKE_DL_LIBS}
EGL::EGL
Qt::Core
Qt::Gui
Qt::OpenGLPrivate
Qt::WaylandClientPrivate
Wayland::Client
Wayland::Egl
)
#### Keys ignored in scope 1:.:.:wayland-egl.pro:<TRUE>:
# OTHER_FILES = "wayland-egl.json"

View File

@ -3,6 +3,7 @@
##################################################################### #####################################################################
## QWaylandEglClientBufferPlugin Plugin: ## QWaylandEglClientBufferPlugin Plugin:
##################################################################### #####################################################################
qt_find_package(EGL) # special case
qt_internal_add_plugin(QWaylandEglClientBufferPlugin qt_internal_add_plugin(QWaylandEglClientBufferPlugin
OUTPUT_NAME qt-plugin-wayland-egl OUTPUT_NAME qt-plugin-wayland-egl
@ -16,9 +17,9 @@ qt_internal_add_plugin(QWaylandEglClientBufferPlugin
INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES
../../../../hardwareintegration/client/wayland-egl ../../../../hardwareintegration/client/wayland-egl
PUBLIC_LIBRARIES PUBLIC_LIBRARIES
${CMAKE_DL_LIBS}
EGL::EGL EGL::EGL
Qt::Core Qt::Core
Qt::EglSupportPrivate
Qt::Gui Qt::Gui
Qt::OpenGLPrivate Qt::OpenGLPrivate
Qt::WaylandClientPrivate Qt::WaylandClientPrivate

View File

@ -0,0 +1,36 @@
# Generated from xcomposite-egl.pro.
#####################################################################
## QWaylandXCompositeEglClientBufferPlugin Plugin:
#####################################################################
qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin
OUTPUT_NAME xcomposite-egl
TYPE wayland-graphics-integration-client
SOURCES
../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h
../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp ../../../../hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h
../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp ../../../../hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h
main.cpp
INCLUDE_DIRECTORIES
../../../../hardwareintegration/client/xcomposite-egl
../../../../hardwareintegration/client/xcomposite_share
PUBLIC_LIBRARIES
EGL::EGL
PkgConfig::XComposite
Qt::Core
Qt::Gui
Qt::WaylandClientPrivate
Wayland::Client
X11::X11
)
qt6_generate_wayland_protocol_client_sources(QWaylandXCompositeEglClientBufferPlugin
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../../../../hardwareintegration/client/xcomposite_share/../../../extensions/xcomposite.xml
)
#### Keys ignored in scope 1:.:.:xcomposite-egl.pro:<TRUE>:
# OTHER_FILES = "xcomposite-egl.json"
# QMAKE_CXXFLAGS_WARN_ON = "--Wcast-qual"

View File

@ -3,6 +3,7 @@
##################################################################### #####################################################################
## QWaylandXCompositeEglClientBufferPlugin Plugin: ## QWaylandXCompositeEglClientBufferPlugin Plugin:
##################################################################### #####################################################################
qt_find_package(EGL) # special case
qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin
OUTPUT_NAME xcomposite-egl OUTPUT_NAME xcomposite-egl
@ -20,7 +21,6 @@ qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin
EGL::EGL EGL::EGL
PkgConfig::XComposite PkgConfig::XComposite
Qt::Core Qt::Core
Qt::EglSupportPrivate
Qt::Gui Qt::Gui
Qt::WaylandClientPrivate Qt::WaylandClientPrivate
Wayland::Client Wayland::Client

View File

@ -20,7 +20,6 @@ qt_internal_add_plugin(QWaylandXCompositeGlxClientBufferPlugin
${CMAKE_DL_LIBS} ${CMAKE_DL_LIBS}
PkgConfig::XComposite PkgConfig::XComposite
Qt::Core Qt::Core
Qt::GlxSupportPrivate
Qt::Gui Qt::Gui
Qt::WaylandClientPrivate Qt::WaylandClientPrivate
Wayland::Client Wayland::Client

View File

@ -66,7 +66,7 @@
#include <qpa/qplatforminputcontextfactory_p.h> #include <qpa/qplatforminputcontextfactory_p.h>
#if QT_CONFIG(xkbcommon) #if QT_CONFIG(xkbcommon)
#include <QtXkbCommonSupport/private/qxkbcommon_p.h> #include <QtGui/private/qxkbcommon_p.h>
#endif #endif
struct wl_cursor_image; struct wl_cursor_image;

View File

@ -1428,16 +1428,16 @@ void QWaylandInputDevice::handleTouchPoint(int id, Qt::TouchPointState state, co
} }
// If the touch point was pressed earlier this frame, we don't want to overwrite its state. // If the touch point was pressed earlier this frame, we don't want to overwrite its state.
if (tp.state != Qt::TouchPointPressed) if (tp.state != QEventPoint::Pressed)
tp.state = state; tp.state = QEventPoint::State(state);
tp.pressure = tp.state == Qt::TouchPointReleased ? 0 : 1; tp.pressure = tp.state == QEventPoint::Released ? 0 : 1;
} }
bool QWaylandInputDevice::Touch::allTouchPointsReleased() bool QWaylandInputDevice::Touch::allTouchPointsReleased()
{ {
for (const auto &tp : qAsConst(mPendingTouchPoints)) { for (const auto &tp : qAsConst(mPendingTouchPoints)) {
if (tp.state != Qt::TouchPointReleased) if (tp.state != QEventPoint::Released)
return false; return false;
} }
return true; return true;
@ -1449,7 +1449,7 @@ void QWaylandInputDevice::Touch::releasePoints()
return; return;
for (QWindowSystemInterface::TouchPoint &tp : mPendingTouchPoints) for (QWindowSystemInterface::TouchPoint &tp : mPendingTouchPoints)
tp.state = Qt::TouchPointReleased; tp.state = QEventPoint::Released;
touch_frame(); touch_frame();
} }
@ -1467,7 +1467,7 @@ void QWaylandInputDevice::Touch::touch_frame()
QMargins margins = window->frameMargins(); QMargins margins = window->frameMargins();
QPoint p = tp.area.center().toPoint(); QPoint p = tp.area.center().toPoint();
QPointF localPos(window->mapFromGlobal(QPoint(p.x() + margins.left(), p.y() + margins.top()))); QPointF localPos(window->mapFromGlobal(QPoint(p.x() + margins.left(), p.y() + margins.top())));
if (mFocus->touchDragDecoration(mParent, localPos, tp.area.center(), tp.state, mParent->modifiers())) if (mFocus->touchDragDecoration(mParent, localPos, tp.area.center(), Qt::TouchPointState(tp.state), mParent->modifiers()))
return; return;
} }
@ -1478,9 +1478,9 @@ void QWaylandInputDevice::Touch::touch_frame()
mPendingTouchPoints.clear(); mPendingTouchPoints.clear();
for (const auto &prevPoint: prevTouchPoints) { for (const auto &prevPoint: prevTouchPoints) {
// All non-released touch points should be part of the next touch event // All non-released touch points should be part of the next touch event
if (prevPoint.state != Qt::TouchPointReleased) { if (prevPoint.state != QEventPoint::Released) {
QWindowSystemInterface::TouchPoint tp = prevPoint; QWindowSystemInterface::TouchPoint tp = prevPoint;
tp.state = Qt::TouchPointStationary; // ... as stationary (unless proven otherwise) tp.state = QEventPoint::Stationary; // ... as stationary (unless proven otherwise)
mPendingTouchPoints.append(tp); mPendingTouchPoints.append(tp);
} }
} }

View File

@ -65,7 +65,7 @@
#include <QtWaylandClient/private/qwayland-wayland.h> #include <QtWaylandClient/private/qwayland-wayland.h>
#if QT_CONFIG(xkbcommon) #if QT_CONFIG(xkbcommon)
#include <QtXkbCommonSupport/private/qxkbcommon_p.h> #include <QtGui/private/qxkbcommon_p.h>
#endif #endif
#include <QtCore/QDebug> #include <QtCore/QDebug>

View File

@ -89,11 +89,11 @@
#include "qwaylandinputdeviceintegrationfactory_p.h" #include "qwaylandinputdeviceintegrationfactory_p.h"
#if QT_CONFIG(accessibility_atspi_bridge) #if QT_CONFIG(accessibility_atspi_bridge)
#include <QtLinuxAccessibilitySupport/private/bridge_p.h> #include <QtGui/private/qspiaccessiblebridge_p.h>
#endif #endif
#if QT_CONFIG(xkbcommon) #if QT_CONFIG(xkbcommon)
#include <QtXkbCommonSupport/private/qxkbcommon_p.h> #include <QtGui/private/qxkbcommon_p.h>
#endif #endif
#if QT_CONFIG(vulkan) #if QT_CONFIG(vulkan)

View File

@ -55,7 +55,7 @@
#include <QtWaylandClient/private/qwaylandvulkanwindow_p.h> #include <QtWaylandClient/private/qwaylandvulkanwindow_p.h>
#endif #endif
#include <QtPlatformHeaders/qwaylandwindowfunctions.h> #include <QtPlatformHeaders/private/qwaylandwindowfunctions_p.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE

View File

@ -101,13 +101,12 @@ void QWaylandTouchExtension::touch_extension_touch(uint32_t time,
QWindowSystemInterface::TouchPoint tp; QWindowSystemInterface::TouchPoint tp;
tp.id = id; tp.id = id;
tp.state = Qt::TouchPointState(int(state & 0xFFFF)); tp.state = QEventPoint::State(int(state & 0xFFFF));
int sentPointCount = state >> 16; int sentPointCount = state >> 16;
if (!mPointsLeft) { if (!mPointsLeft) {
Q_ASSERT(sentPointCount > 0); Q_ASSERT(sentPointCount > 0);
mPointsLeft = sentPointCount; mPointsLeft = sentPointCount;
} }
tp.flags = QTouchEvent::TouchPoint::InfoFlags(int(flags & 0xFFFF));
if (!mTouchDevice) if (!mTouchDevice)
registerDevice(flags >> 16); registerDevice(flags >> 16);
@ -146,7 +145,7 @@ void QWaylandTouchExtension::sendTouchEvent()
// Copy all points, that are in the previous but not in the current list, as stationary. // Copy all points, that are in the previous but not in the current list, as stationary.
for (int i = 0; i < mPrevTouchPoints.count(); ++i) { for (int i = 0; i < mPrevTouchPoints.count(); ++i) {
const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i)); const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i));
if (prevPoint.state == Qt::TouchPointReleased) if (prevPoint.state == QEventPoint::Released)
continue; continue;
bool found = false; bool found = false;
for (int j = 0; j < mTouchPoints.count(); ++j) for (int j = 0; j < mTouchPoints.count(); ++j)
@ -156,7 +155,7 @@ void QWaylandTouchExtension::sendTouchEvent()
} }
if (!found) { if (!found) {
QWindowSystemInterface::TouchPoint p = prevPoint; QWindowSystemInterface::TouchPoint p = prevPoint;
p.state = Qt::TouchPointStationary; p.state = QEventPoint::Stationary;
mTouchPoints.append(p); mTouchPoints.append(p);
} }
} }
@ -168,7 +167,7 @@ void QWaylandTouchExtension::sendTouchEvent()
QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints); QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints);
Qt::TouchPointStates states = {}; QEventPoint::States states = {};
for (int i = 0; i < mTouchPoints.count(); ++i) for (int i = 0; i < mTouchPoints.count(); ++i)
states |= mTouchPoints.at(i).state; states |= mTouchPoints.at(i).state;
@ -179,7 +178,7 @@ void QWaylandTouchExtension::sendTouchEvent()
for (int i = 0; i < mTouchPoints.count(); ++i) { for (int i = 0; i < mTouchPoints.count(); ++i) {
const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i)); const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i));
if (tp.id == mMouseSourceId) { if (tp.id == mMouseSourceId) {
const bool released = tp.state == Qt::TouchPointReleased; const bool released = tp.state == QEventPoint::Released;
Qt::MouseButtons buttons = released ? Qt::NoButton : Qt::LeftButton; Qt::MouseButtons buttons = released ? Qt::NoButton : Qt::LeftButton;
QEvent::Type eventType = firstPress ? QEvent::MouseButtonPress QEvent::Type eventType = firstPress ? QEvent::MouseButtonPress
: released ? QEvent::MouseButtonRelease : released ? QEvent::MouseButtonRelease

View File

@ -398,7 +398,7 @@ public:
{ {
} }
QEvent::Type type{}; QEvent::Type type{};
Qt::TouchPointStates touchPointStates{}; QEventPoint::States touchPointStates{};
QList<QTouchEvent::TouchPoint> touchPoints; QList<QTouchEvent::TouchPoint> touchPoints;
}; };
QList<Event> m_events; QList<Event> m_events;

View File

@ -465,11 +465,11 @@ protected:
case QEvent::TabletEnterProximity: case QEvent::TabletEnterProximity:
case QEvent::TabletLeaveProximity: { case QEvent::TabletLeaveProximity: {
auto *e = static_cast<QTabletEvent *>(event); auto *e = static_cast<QTabletEvent *>(event);
auto *ev = new QTabletEvent(e->type(), e->position(), e->globalPosition(), int(e->deviceType()), auto *ev = new QTabletEvent(e->type(), e->pointingDevice(), e->position(), e->globalPosition(),
int(e->pointerType()), e->pressure(), e->xTilt(), e->yTilt(), e->pressure(), e->xTilt(), e->yTilt(),
e->tangentialPressure(), e->rotation(), e->z(), e->tangentialPressure(), e->rotation(), e->z(),
Qt::KeyboardModifier::NoModifier, e->uniqueId(), Qt::KeyboardModifier::NoModifier,
e->button(), e->buttons()); e->button(), e->buttons());
m_events << ev; m_events << ev;
break; break;
} }
@ -600,11 +600,11 @@ public:
void tabletEvent(QTabletEvent *e) override void tabletEvent(QTabletEvent *e) override
{ {
m_events << new QTabletEvent(e->type(), e->position(), e->globalPosition(), int(e->deviceType()), m_events << new QTabletEvent(e->type(), e->pointingDevice(), e->position(), e->globalPosition(),
int(e->pointerType()), e->pressure(), e->xTilt(), e->yTilt(), e->pressure(), e->xTilt(), e->yTilt(),
e->tangentialPressure(), e->rotation(), e->z(), e->tangentialPressure(), e->rotation(), e->z(),
Qt::KeyboardModifier::NoModifier, e->uniqueId(), e->button(), Qt::KeyboardModifier::NoModifier,
e->buttons()); e->button(), e->buttons());
emit tabletEventReceived(m_events.last()); emit tabletEventReceived(m_events.last());
} }
int nextEventIndex = 0; int nextEventIndex = 0;