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
Qt::CorePrivate
Qt::GuiPrivate
Qt::PlatformHeadersPrivate
PUBLIC_LIBRARIES
Qt::Core
Qt::Gui
@ -87,18 +88,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## 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
SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -56,6 +56,7 @@ qt_add_module(WaylandClient
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
Qt::PlatformHeadersPrivate
PUBLIC_LIBRARIES
Qt::Core
Qt::Gui
@ -87,18 +88,6 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## 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
SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -3,6 +3,8 @@ MODULE = waylandclient
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
QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
@ -13,13 +15,6 @@ use_gold_linker: CONFIG += no_linker_version_script
CONFIG -= precompile_header
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
INCLUDEPATH += $$PWD/../shared

View File

@ -18,7 +18,6 @@ qt_internal_add_plugin(QWaylandBrcmEglClientBufferPlugin
${CMAKE_DL_LIBS}
EGL::EGL
Qt::Core
Qt::EglSupportPrivate
Qt::Gui
Qt::WaylandClientPrivate
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:
#####################################################################
qt_find_package(EGL) # special case
qt_internal_add_plugin(QWaylandEglClientBufferPlugin
OUTPUT_NAME qt-plugin-wayland-egl
@ -16,9 +17,9 @@ qt_internal_add_plugin(QWaylandEglClientBufferPlugin
INCLUDE_DIRECTORIES
../../../../hardwareintegration/client/wayland-egl
PUBLIC_LIBRARIES
${CMAKE_DL_LIBS}
EGL::EGL
Qt::Core
Qt::EglSupportPrivate
Qt::Gui
Qt::OpenGLPrivate
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:
#####################################################################
qt_find_package(EGL) # special case
qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin
OUTPUT_NAME xcomposite-egl
@ -20,7 +21,6 @@ qt_internal_add_plugin(QWaylandXCompositeEglClientBufferPlugin
EGL::EGL
PkgConfig::XComposite
Qt::Core
Qt::EglSupportPrivate
Qt::Gui
Qt::WaylandClientPrivate
Wayland::Client

View File

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

View File

@ -66,7 +66,7 @@
#include <qpa/qplatforminputcontextfactory_p.h>
#if QT_CONFIG(xkbcommon)
#include <QtXkbCommonSupport/private/qxkbcommon_p.h>
#include <QtGui/private/qxkbcommon_p.h>
#endif
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 (tp.state != Qt::TouchPointPressed)
tp.state = state;
if (tp.state != QEventPoint::Pressed)
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()
{
for (const auto &tp : qAsConst(mPendingTouchPoints)) {
if (tp.state != Qt::TouchPointReleased)
if (tp.state != QEventPoint::Released)
return false;
}
return true;
@ -1449,7 +1449,7 @@ void QWaylandInputDevice::Touch::releasePoints()
return;
for (QWindowSystemInterface::TouchPoint &tp : mPendingTouchPoints)
tp.state = Qt::TouchPointReleased;
tp.state = QEventPoint::Released;
touch_frame();
}
@ -1467,7 +1467,7 @@ void QWaylandInputDevice::Touch::touch_frame()
QMargins margins = window->frameMargins();
QPoint p = tp.area.center().toPoint();
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;
}
@ -1478,9 +1478,9 @@ void QWaylandInputDevice::Touch::touch_frame()
mPendingTouchPoints.clear();
for (const auto &prevPoint: prevTouchPoints) {
// 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;
tp.state = Qt::TouchPointStationary; // ... as stationary (unless proven otherwise)
tp.state = QEventPoint::Stationary; // ... as stationary (unless proven otherwise)
mPendingTouchPoints.append(tp);
}
}

View File

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

View File

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

View File

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

View File

@ -101,13 +101,12 @@ void QWaylandTouchExtension::touch_extension_touch(uint32_t time,
QWindowSystemInterface::TouchPoint tp;
tp.id = id;
tp.state = Qt::TouchPointState(int(state & 0xFFFF));
tp.state = QEventPoint::State(int(state & 0xFFFF));
int sentPointCount = state >> 16;
if (!mPointsLeft) {
Q_ASSERT(sentPointCount > 0);
mPointsLeft = sentPointCount;
}
tp.flags = QTouchEvent::TouchPoint::InfoFlags(int(flags & 0xFFFF));
if (!mTouchDevice)
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.
for (int i = 0; i < mPrevTouchPoints.count(); ++i) {
const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i));
if (prevPoint.state == Qt::TouchPointReleased)
if (prevPoint.state == QEventPoint::Released)
continue;
bool found = false;
for (int j = 0; j < mTouchPoints.count(); ++j)
@ -156,7 +155,7 @@ void QWaylandTouchExtension::sendTouchEvent()
}
if (!found) {
QWindowSystemInterface::TouchPoint p = prevPoint;
p.state = Qt::TouchPointStationary;
p.state = QEventPoint::Stationary;
mTouchPoints.append(p);
}
}
@ -168,7 +167,7 @@ void QWaylandTouchExtension::sendTouchEvent()
QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints);
Qt::TouchPointStates states = {};
QEventPoint::States states = {};
for (int i = 0; i < mTouchPoints.count(); ++i)
states |= mTouchPoints.at(i).state;
@ -179,7 +178,7 @@ void QWaylandTouchExtension::sendTouchEvent()
for (int i = 0; i < mTouchPoints.count(); ++i) {
const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i));
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;
QEvent::Type eventType = firstPress ? QEvent::MouseButtonPress
: released ? QEvent::MouseButtonRelease

View File

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

View File

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