summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-03 03:00:50 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-12-03 08:10:44 +0100
commiteae93ae4495fe9bfa4f8d1e6dfd03aee04ccc281 (patch)
tree8f8abacc14202b8a0ae0aebe577558dc4b6afd1e /src
parent79a565fb7542ec154cacd0e95725d4d89dfc13e3 (diff)
parentce06115da6bf4c8d891ff0aa382dd2b1f5b4bf65 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: src/compositor/configure.json Change-Id: Id608424a63a4bcef4adb3f66d55a3cc32c86f2a2
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandcursor.cpp12
-rw-r--r--src/client/qwaylandcursor_p.h3
-rw-r--r--src/client/qwaylandinputdevice.cpp16
-rw-r--r--src/compositor/configure.json4
-rw-r--r--src/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri2
-rw-r--r--src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri2
6 files changed, 19 insertions, 20 deletions
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp
index 4356b23a0..1d3d88bea 100644
--- a/src/client/qwaylandcursor.cpp
+++ b/src/client/qwaylandcursor.cpp
@@ -219,7 +219,7 @@ wl_cursor *QWaylandCursorTheme::requestCursor(WaylandCursor shape)
return nullptr;
}
-::wl_cursor_image *QWaylandCursorTheme::cursorImage(Qt::CursorShape shape, uint millisecondsIntoAnimation)
+::wl_cursor *QWaylandCursorTheme::cursor(Qt::CursorShape shape)
{
struct wl_cursor *waylandCursor = nullptr;
@@ -237,15 +237,7 @@ wl_cursor *QWaylandCursorTheme::requestCursor(WaylandCursor shape)
return nullptr;
}
- int frame = wl_cursor_frame(waylandCursor, millisecondsIntoAnimation);
- ::wl_cursor_image *image = waylandCursor->images[frame];
- ::wl_buffer *buffer = wl_cursor_image_get_buffer(image);
- if (!buffer) {
- qCWarning(lcQpaWayland) << "Could not find buffer for cursor";
- return nullptr;
- }
-
- return image;
+ return waylandCursor;
}
QWaylandCursor::QWaylandCursor(QWaylandDisplay *display)
diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h
index a4605f3d2..751ffa68b 100644
--- a/src/client/qwaylandcursor_p.h
+++ b/src/client/qwaylandcursor_p.h
@@ -75,7 +75,7 @@ class Q_WAYLAND_CLIENT_EXPORT QWaylandCursorTheme
public:
static QWaylandCursorTheme *create(QWaylandShm *shm, int size, const QString &themeName);
~QWaylandCursorTheme();
- ::wl_cursor_image *cursorImage(Qt::CursorShape shape, uint millisecondsIntoAnimation = 0);
+ ::wl_cursor *cursor(Qt::CursorShape shape);
private:
enum WaylandCursor {
@@ -129,7 +129,6 @@ public:
void setPos(const QPoint &pos) override;
static QSharedPointer<QWaylandBuffer> cursorBitmapBuffer(QWaylandDisplay *display, const QCursor *cursor);
- struct wl_cursor_image *cursorImage(Qt::CursorShape shape);
private:
QWaylandDisplay *mDisplay = nullptr;
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index a4098edd3..d812918e7 100644
--- a/src/client/qwaylandinputdevice.cpp
+++ b/src/client/qwaylandinputdevice.cpp
@@ -283,8 +283,8 @@ void QWaylandInputDevice::Pointer::updateCursorTheme()
if (!mCursor.theme)
return; // A warning has already been printed in loadCursorTheme
- if (auto *arrow = mCursor.theme->cursorImage(Qt::ArrowCursor)) {
- int arrowPixelSize = qMax(arrow->width, arrow->height); // Not all cursor themes are square
+ if (auto *arrow = mCursor.theme->cursor(Qt::ArrowCursor)) {
+ int arrowPixelSize = qMax(arrow->images[0]->width, arrow->images[0]->height); // Not all cursor themes are square
while (scale > 1 && arrowPixelSize / scale < cursorSize())
--scale;
} else {
@@ -326,12 +326,20 @@ void QWaylandInputDevice::Pointer::updateCursor()
// Set from shape using theme
uint time = seat()->mCursor.animationTimer.elapsed();
- if (struct ::wl_cursor_image *image = mCursor.theme->cursorImage(shape, time)) {
+
+ if (struct ::wl_cursor *waylandCursor = mCursor.theme->cursor(shape)) {
+ int frame = wl_cursor_frame(waylandCursor, time);
+ ::wl_cursor_image *image = waylandCursor->images[frame];
+
struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
+ if (!buffer) {
+ qCWarning(lcQpaWayland) << "Could not find buffer for cursor" << shape;
+ return;
+ }
int bufferScale = mCursor.themeBufferScale;
QPoint hotspot = QPoint(image->hotspot_x, image->hotspot_y) / bufferScale;
QSize size = QSize(image->width, image->height) / bufferScale;
- bool animated = image->delay > 0;
+ bool animated = waylandCursor->image_count > 1 && image->delay > 0;
getOrCreateCursorSurface()->update(buffer, hotspot, size, bufferScale, animated);
return;
}
diff --git a/src/compositor/configure.json b/src/compositor/configure.json
index 2af92ea67..5bbcec287 100644
--- a/src/compositor/configure.json
+++ b/src/compositor/configure.json
@@ -151,7 +151,7 @@
"#endif"
]
},
- "use": "egl"
+ "use": "egl drm"
},
"dmabuf-client-buffer": {
"label": "Linux Client dma-buf Buffer Sharing",
@@ -175,7 +175,7 @@
"return 0;"
]
},
- "use": "egl"
+ "use": "egl drm"
},
"vulkan-server-buffer": {
"label": "Vulkan Buffer Sharing",
diff --git a/src/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri b/src/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri
index 2df101092..41f483c48 100644
--- a/src/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri
+++ b/src/hardwareintegration/compositor/dmabuf-server/dmabuf-server.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-QMAKE_USE_PRIVATE += egl wayland-server
+QMAKE_USE_PRIVATE += egl drm wayland-server
SOURCES += \
$$PWD/dmabufserverbufferintegration.cpp
diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri
index a7630040e..4dbbae194 100644
--- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri
+++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linux-dmabuf-unstable-v1.pri
@@ -1,6 +1,6 @@
INCLUDEPATH += $$PWD
-QMAKE_USE_PRIVATE += egl wayland-server
+QMAKE_USE_PRIVATE += egl drm wayland-server
CONFIG += wayland-scanner
WAYLANDSERVERSOURCES += $$PWD/../../../3rdparty/protocol/linux-dmabuf-unstable-v1.xml