Accepting request 768036 from home:Vogtinator:qt5.14

Qt 5.14.1 - untested, as usual

OBS-URL: https://build.opensuse.org/request/show/768036
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt:5.14/libqt5-qtwayland?expand=0&rev=9
This commit is contained in:
Christophe Giboudeaux 2020-01-28 16:31:34 +00:00 committed by Git OBS Bridge
parent 3e0f65a811
commit 371e5b31c4
5 changed files with 17 additions and 131 deletions

View File

@ -1,122 +0,0 @@
From 8a200369acf25841cb4fbfbc6b3866d851388306 Mon Sep 17 00:00:00 2001
From: David Edmundson <davidedmundson@kde.org>
Date: Thu, 28 Nov 2019 02:31:17 +0100
Subject: [PATCH] Avoid animating single frame cursors
Currently to determine if a cursor is animated or not we check the
cursor theme delay.
This doesn't work in practice as by default many cursor themes have a
delay of 50 set even if they don't animate.
This comes from xcursorgen which specifies a delay of 50ms if there
isn't anything set in the config.
(https://github.com/freedesktop/xcursorgen/blob/master/xcursorgen.c#L92)
Given many themes will have a delay we should also check the number of
images in a given cursor.
In order to do that without a double lookup QWaylandCursor needed to
return the native wl_cursor, not wl_cursor_image and move the relevant
logic.
Change-Id: Ie782ace8054910ae76e61cab33ceca0377194929
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
---
src/client/qwaylandcursor.cpp | 12 ++----------
src/client/qwaylandcursor_p.h | 3 +--
src/client/qwaylandinputdevice.cpp | 16 ++++++++++++----
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp
index 4356b23a..1d3d88be 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 a4605f3d..751ffa68 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 a4098edd..d812918e 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;
}
--
2.23.0

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jan 27 13:14:42 UTC 2020 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 5.14.1:
* New bugfix release
* For more details please see:
http://code.qt.io/cgit/qt/qtwayland.git/plain/dist/changes-5.14.1/?h=v5.14.1
- Drop patches, now upstream:
* 0001-Avoid-animating-single-frame-cursors.patch
-------------------------------------------------------------------
Sun Dec 22 22:52:51 UTC 2019 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -19,11 +19,11 @@
%define qt5_snapshot 0
%define libname libQt5WaylandCompositor5
%define base_name libqt5
%define real_version 5.14.0
%define so_version 5.14.0
%define tar_version qtwayland-everywhere-src-5.14.0
%define real_version 5.14.1
%define so_version 5.14.1
%define tar_version qtwayland-everywhere-src-5.14.1
Name: libqt5-qtwayland
Version: 5.14.0
Version: 5.14.1
Release: 0
Summary: Qt 5 Wayland Addon
# The wayland compositor files are GPL-3.0-or-later
@ -32,8 +32,6 @@ Group: Development/Libraries/X11
URL: https://www.qt.io
Source: https://download.qt.io/official_releases/qt/5.14/%{real_version}/submodules/%{tar_version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-UPSTREAM
Patch1: 0001-Avoid-animating-single-frame-cursors.patch
# PATCH-FIX-OPENSUSE
Patch100: fix-return-nonvoid-function.patch
BuildRequires: fdupes

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:32d4fadb3a8dcee8953e6d92ee567927cd7649be6fc8dd378480664902c22610
size 544292

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2a03b9f554e88c5824ef237c814b3dd45844c022e97be0e091f4a502ca4c9520
size 544744