[arch-commits] Commit in qt5-wayland/repos/testing-x86_64 (3 files)

Antonio Rojas arojas at archlinux.org
Fri Dec 20 09:39:54 UTC 2019


    Date: Friday, December 20, 2019 @ 09:39:53
  Author: arojas
Revision: 371955

archrelease: copy trunk to testing-x86_64

Added:
  qt5-wayland/repos/testing-x86_64/0001-Drive-cursor-animation-with-a-timer.patch
    (from rev 371954, qt5-wayland/trunk/0001-Drive-cursor-animation-with-a-timer.patch)
  qt5-wayland/repos/testing-x86_64/PKGBUILD
    (from rev 371954, qt5-wayland/trunk/PKGBUILD)
Deleted:
  qt5-wayland/repos/testing-x86_64/PKGBUILD

------------------------------------------------+
 0001-Drive-cursor-animation-with-a-timer.patch |  124 +++++++++++++++++++++++
 PKGBUILD                                       |  107 +++++++++++--------
 2 files changed, 185 insertions(+), 46 deletions(-)

Copied: qt5-wayland/repos/testing-x86_64/0001-Drive-cursor-animation-with-a-timer.patch (from rev 371954, qt5-wayland/trunk/0001-Drive-cursor-animation-with-a-timer.patch)
===================================================================
--- 0001-Drive-cursor-animation-with-a-timer.patch	                        (rev 0)
+++ 0001-Drive-cursor-animation-with-a-timer.patch	2019-12-20 09:39:53 UTC (rev 371955)
@@ -0,0 +1,124 @@
+From 78b7b39d408077ad139cba3087b54142533852bb Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
+Date: Fri, 13 Dec 2019 22:15:32 +0100
+Subject: [PATCH] Drive cursor animation with a timer
+
+Using only wl_surface_frame callbacks to update the cursor does so much
+more often than needed. In addition, at least GNOME and Weston fire the
+callback for the cursor surface immediately, which ends up updating the
+cursor at over 3000 Hz here.
+
+Use wl_cursor_frame_and_duration to drive a single shot timer. This
+function is also guaranteed to return 0 for single frame cursors, so we
+can avoid starting the timer at all.
+
+We wait for both the surface frame callback and the timer to fire before
+updating the cursor for the next frame of animation. This reduces our
+update rate to the frame rate of the cursor or the rate requested by the
+compositor, whichever is lower.
+
+Change-Id: I10277460ebe9b547ebaf7f73424b9ef17614107f
+---
+ src/client/qwaylandinputdevice.cpp | 34 +++++++++++++++++++++++++++---
+ src/client/qwaylandinputdevice_p.h |  5 +++++
+ 2 files changed, 36 insertions(+), 3 deletions(-)
+
+diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
+index d812918e..e740b9c2 100644
+--- a/src/client/qwaylandinputdevice.cpp
++++ b/src/client/qwaylandinputdevice.cpp
+@@ -143,6 +143,12 @@ QWaylandWindow *QWaylandInputDevice::Keyboard::focusWindow() const
+ QWaylandInputDevice::Pointer::Pointer(QWaylandInputDevice *seat)
+     : mParent(seat)
+ {
++#if QT_CONFIG(cursor)
++    mCursor.frameTimer.setSingleShot(true);
++    mCursor.frameTimer.callOnTimeout([&]() {
++        cursorTimerCallback();
++    });
++#endif
+ }
+ 
+ QWaylandInputDevice::Pointer::~Pointer()
+@@ -224,7 +230,7 @@ public:
+         if (animated) {
+             m_frameCallback.reset(new WlCallback(frame(), [this](uint32_t time){
+                Q_UNUSED(time);
+-               m_pointer->updateCursor();
++               m_pointer->cursorFrameCallback();
+             }));
+         }
+         commit();
+@@ -328,7 +334,8 @@ void QWaylandInputDevice::Pointer::updateCursor()
+     uint time = seat()->mCursor.animationTimer.elapsed();
+ 
+     if (struct ::wl_cursor *waylandCursor = mCursor.theme->cursor(shape)) {
+-        int frame = wl_cursor_frame(waylandCursor, time);
++        uint duration = 0;
++        int frame = wl_cursor_frame_and_duration(waylandCursor, time, &duration);
+         ::wl_cursor_image *image = waylandCursor->images[frame];
+ 
+         struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
+@@ -339,7 +346,12 @@ void QWaylandInputDevice::Pointer::updateCursor()
+         int bufferScale = mCursor.themeBufferScale;
+         QPoint hotspot = QPoint(image->hotspot_x, image->hotspot_y) / bufferScale;
+         QSize size = QSize(image->width, image->height) / bufferScale;
+-        bool animated = waylandCursor->image_count > 1 && image->delay > 0;
++        bool animated = duration > 0;
++        if (animated) {
++            mCursor.gotFrameCallback = false;
++            mCursor.gotTimerCallback = false;
++            mCursor.frameTimer.start(duration);
++        }
+         getOrCreateCursorSurface()->update(buffer, hotspot, size, bufferScale, animated);
+         return;
+     }
+@@ -354,6 +366,22 @@ CursorSurface *QWaylandInputDevice::Pointer::getOrCreateCursorSurface()
+     return mCursor.surface.get();
+ }
+ 
++void QWaylandInputDevice::Pointer::cursorTimerCallback()
++{
++    mCursor.gotTimerCallback = true;
++    if (mCursor.gotFrameCallback) {
++        updateCursor();
++    }
++}
++
++void QWaylandInputDevice::Pointer::cursorFrameCallback()
++{
++    mCursor.gotFrameCallback = true;
++    if (mCursor.gotTimerCallback) {
++        updateCursor();
++    }
++}
++
+ #endif // QT_CONFIG(cursor)
+ 
+ QWaylandInputDevice::Touch::Touch(QWaylandInputDevice *p)
+diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h
+index 60d6f2c1..a567c57b 100644
+--- a/src/client/qwaylandinputdevice_p.h
++++ b/src/client/qwaylandinputdevice_p.h
+@@ -286,6 +286,8 @@ public:
+     int idealCursorScale() const;
+     void updateCursorTheme();
+     void updateCursor();
++    void cursorTimerCallback();
++    void cursorFrameCallback();
+     CursorSurface *getOrCreateCursorSurface();
+ #endif
+     QWaylandInputDevice *seat() const { return mParent; }
+@@ -325,6 +327,9 @@ public:
+         QWaylandCursorTheme *theme = nullptr;
+         int themeBufferScale = 0;
+         QScopedPointer<CursorSurface> surface;
++        QTimer frameTimer;
++        bool gotFrameCallback = false;
++        bool gotTimerCallback = false;
+     } mCursor;
+ #endif
+     QPointF mSurfacePos;
+-- 
+2.24.1
+

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2019-12-20 09:39:35 UTC (rev 371954)
+++ PKGBUILD	2019-12-20 09:39:53 UTC (rev 371955)
@@ -1,46 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Andrea Scarpino <andrea at archlinux.org>
-
-pkgname=qt5-wayland
-_qtver=5.14.0
-pkgver=${_qtver/-/}
-pkgrel=2
-arch=('x86_64')
-url='https://www.qt.io'
-license=('GPL3' 'LGPL3' 'FDL' 'custom')
-pkgdesc='Provides APIs for Wayland'
-depends=('qt5-declarative' 'libxcomposite')
-makedepends=('vulkan-headers')
-groups=('qt' 'qt5')
-_pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
-source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
-         qt5-wayland-animate-cursor.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=36974955")
-sha256sums=('32d4fadb3a8dcee8953e6d92ee567927cd7649be6fc8dd378480664902c22610'
-            'b04b021cf78bfe765616cc385e85ac00aae13c0e5d2b969e9ccf66a3763670fb')
-
-prepare() {
-  mkdir -p build
-
-  cd $_pkgfqn
-  patch -p1 -i ../qt5-wayland-animate-cursor.patch # Fix flickering and high CPU with wayland cursors
-}
-
-build() {
-  cd build
-
-  qmake ../${_pkgfqn}
-  make
-}
-
-package() {
-  cd build
-
-  make INSTALL_ROOT="$pkgdir" install
-
-  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
-  find "$pkgdir/usr/lib" -type f -name '*.prl' \
-    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
-
-  install -d "$pkgdir"/usr/share/licenses
-  ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname}
-}

Copied: qt5-wayland/repos/testing-x86_64/PKGBUILD (from rev 371954, qt5-wayland/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2019-12-20 09:39:53 UTC (rev 371955)
@@ -0,0 +1,61 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Andrea Scarpino <andrea at archlinux.org>
+
+pkgname=qt5-wayland
+_qtver=5.14.0
+pkgver=${_qtver/-/}
+pkgrel=2
+arch=('x86_64')
+url='https://www.qt.io'
+license=('GPL3' 'LGPL3' 'FDL' 'custom')
+pkgdesc='Provides APIs for Wayland'
+depends=('qt5-declarative' 'libxcomposite')
+makedepends=('vulkan-headers' 'xorgproto')
+groups=('qt' 'qt5')
+_pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
+source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
+        qt5-wayland-animate-cursor.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=36974955"
+        qt5-wayland-cursor-timer.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=ce158896"
+        qt5-wayland-linux-dmabuf.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=09861f00"
+        qt5-wayland-linux-dmabuf-2.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=a2be69d4"
+        qt5-wayland-libglvnd-egl.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=c2105d8b"
+        qtbug-80613.patch::"https://code.qt.io/cgit/qt/qtwayland.git/patch/?id=80ed5501")
+sha256sums=('32d4fadb3a8dcee8953e6d92ee567927cd7649be6fc8dd378480664902c22610'
+            'b04b021cf78bfe765616cc385e85ac00aae13c0e5d2b969e9ccf66a3763670fb'
+            '5cf52ce4db458ca316c304ae5ad86158bd7cd5aec74d85fe66896ae27f953560'
+            '708daee5fdeea7b7e7a98706c93ac068ec1947d87126c2d7dbdf72e4e3ea0508'
+            'd40de7d22445aaaa5a8741fc8aff13d33a79e926faa16e46239f64fd85db5c12'
+            'e8dd89665619aa00874b4c39317366007a8e83bad81a2c3f404880e30591af83'
+            '1535fcb7bfeb931ce55c6cbdff639f708b8e74452e35ee7477bab1b228aee032')
+
+prepare() {
+  mkdir -p build
+
+  cd $_pkgfqn
+  patch -p1 -i ../qt5-wayland-animate-cursor.patch # Fix flickering and high CPU with wayland cursors
+  patch -p1 -i ../qt5-wayland-cursor-timer.patch   # Also fix animated cursors
+  patch -p1 -i ../qt5-wayland-linux-dmabuf.patch   # Fix for DMA-BUF support
+  patch -p1 -i ../qt5-wayland-linux-dmabuf-2.patch # More of the same
+  patch -p1 -i ../qt5-wayland-libglvnd-egl.patch   # Fix compiling with libglvnd's headers
+  patch -p1 -i ../qtbug-80613.patch # Fix keyboard repeat rate
+}
+
+build() {
+  cd build
+
+  qmake ../${_pkgfqn}
+  make
+}
+
+package() {
+  cd build
+
+  make INSTALL_ROOT="$pkgdir" install
+
+  # Drop QMAKE_PRL_BUILD_DIR because reference the build dir
+  find "$pkgdir/usr/lib" -type f -name '*.prl' \
+    -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
+
+  install -d "$pkgdir"/usr/share/licenses
+  ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname}
+}


More information about the arch-commits mailing list