diff --git a/src/qgtkbackingstore.cpp b/src/qgtkbackingstore.cpp index 1abc312..b6b0ed8 100644 --- a/src/qgtkbackingstore.cpp +++ b/src/qgtkbackingstore.cpp @@ -76,10 +76,18 @@ void QGtkBackingStore::endPaint() } void QGtkBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QPlatformTextureList *textures, bool translucentBackground) +#else QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) +#endif { TRACE_EVENT0("gfx", "QGtkBackingStore::composeAndFlush"); +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QPlatformBackingStore::composeAndFlush(window, region, offset, textures, translucentBackground); +#else QPlatformBackingStore::composeAndFlush(window, region, offset, textures, context, translucentBackground); +#endif } void QGtkBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) diff --git a/src/qgtkbackingstore.h b/src/qgtkbackingstore.h index 52ff810..877e80c 100644 --- a/src/qgtkbackingstore.h +++ b/src/qgtkbackingstore.h @@ -43,7 +43,11 @@ class QGtkBackingStore : public QPlatformBackingStore void beginPaint(const QRegion ®ion) override; void endPaint() override; void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QPlatformTextureList *textures, bool translucentBackground) override; +#else QPlatformTextureList *textures, QOpenGLContext *context, bool translucentBackground) override; +#endif void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) override; void resize(const QSize &size, const QRegion &staticContents) override; QImage toImage() const override; diff --git a/src/qgtkwindow.cpp b/src/qgtkwindow.cpp index 5d521f0..00cc3fa 100644 --- a/src/qgtkwindow.cpp +++ b/src/qgtkwindow.cpp @@ -522,8 +522,15 @@ void QGtkWindow::setWindowFlags(Qt::WindowFlags flags) } } -void QGtkWindow::setWindowState(Qt::WindowState state) +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) +void QGtkWindow::setWindowState(Qt::WindowStates requestedState) { + const Qt::WindowState state = QWindowPrivate::effectiveState(requestedState); +#else +void QGtkWindow::setWindowState(Qt::WindowState requestedState) +{ +#endif + if (state == m_state) { return; } diff --git a/src/qgtkwindow.h b/src/qgtkwindow.h index ba7cce3..36e03e5 100644 --- a/src/qgtkwindow.h +++ b/src/qgtkwindow.h @@ -57,7 +57,11 @@ class QGtkWindow : public QPlatformWindow void setVisible(bool visible) override; void setWindowFlags(Qt::WindowFlags flags) override; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + void setWindowState(Qt::WindowStates state) override; +#else void setWindowState(Qt::WindowState state) override; +#endif WId winId() const override; void setParent(const QPlatformWindow *window) override; diff --git a/src/qgtkwindow_gesture.cpp b/src/qgtkwindow_gesture.cpp index 085917a..780de62 100644 --- a/src/qgtkwindow_gesture.cpp +++ b/src/qgtkwindow_gesture.cpp @@ -95,7 +95,11 @@ void QGtkWindow::beginZoom(QPointF &contentPoint, guint32 ts) m_initialZoomSet = false; if (m_activeNativeGestures++ == 0) { qCDebug(lcGesture) << "Started native gesture sequence (due to zoom)"; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEvent(window(), nullptr, ts, Qt::BeginNativeGesture, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEvent(window(), ts, Qt::BeginNativeGesture, contentPoint, contentPoint); +#endif } } @@ -111,14 +115,22 @@ void QGtkWindow::zoom(QPointF &contentPoint, double scale, guint32 ts) } double modScale = (scale - m_initialZoom) / m_initialZoom; m_initialZoom = scale; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEventWithRealValue(window(), nullptr, ts, Qt::ZoomNativeGesture, modScale, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEventWithRealValue(window(), ts, Qt::ZoomNativeGesture, modScale, contentPoint, contentPoint); +#endif } void QGtkWindow::endZoom(QPointF &contentPoint, guint32 ts) { if (--m_activeNativeGestures == 0) { qCDebug(lcGesture) << "Ended native gesture sequence (due to zoom)"; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEvent(window(), nullptr, ts, Qt::EndNativeGesture, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEvent(window(), ts, Qt::EndNativeGesture, contentPoint, contentPoint); +#endif } } @@ -172,7 +184,11 @@ void QGtkWindow::beginRotate(QPointF &contentPoint, guint32 ts) m_initialRotateSet = false; if (m_activeNativeGestures++ == 0) { qCDebug(lcGesture) << "Started native gesture sequence (due to rotate)"; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEvent(window(), nullptr, ts, Qt::BeginNativeGesture, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEvent(window(), ts, Qt::BeginNativeGesture, contentPoint, contentPoint); +#endif } } @@ -186,14 +202,22 @@ void QGtkWindow::rotate(QPointF &contentPoint, double angle, double angle_delta, } double degrees = m_initialRotate - (angle * 180 / M_PI); m_initialRotate = angle * 180 / M_PI; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEventWithRealValue(window(), nullptr, ts, Qt::RotateNativeGesture, degrees, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEventWithRealValue(window(), ts, Qt::RotateNativeGesture, degrees, contentPoint, contentPoint); +#endif } void QGtkWindow::endRotate(QPointF &contentPoint, guint32 ts) { if (--m_activeNativeGestures == 0) { qCDebug(lcGesture) << "Ended native gesture sequence (due to rotate)"; +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGestureEvent(window(), nullptr, ts, Qt::EndNativeGesture, contentPoint, contentPoint); +#else QWindowSystemInterface::handleGestureEvent(window(), ts, Qt::EndNativeGesture, contentPoint, contentPoint); +#endif } } diff --git a/src/qgtkwindow_render.cpp b/src/qgtkwindow_render.cpp index 907f777..a40e6ae 100644 --- a/src/qgtkwindow_render.cpp +++ b/src/qgtkwindow_render.cpp @@ -49,7 +49,11 @@ void QGtkWindow::onDraw(cairo_t *cr) { if (m_newGeometry != m_windowGeometry) { bool needsExpose = m_newGeometry.size() != m_windowGeometry.size(); +#if QT_VERSION >= QT_VERSION_CHECK(5,10,0) + QWindowSystemInterface::handleGeometryChange(window(), m_newGeometry); +#else QWindowSystemInterface::handleGeometryChange(window(), m_newGeometry, m_windowGeometry); +#endif m_windowGeometry = m_newGeometry; if (needsExpose) {