[arch-commits] Commit in deepin-kwin/trunk (3 files)

Felix Yan felixonmars at archlinux.org
Tue Dec 15 10:07:26 UTC 2020


    Date: Tuesday, December 15, 2020 @ 10:07:25
  Author: felixonmars
Revision: 775920

upgpkg: deepin-kwin 5.2.0.11-2: update patches

Added:
  deepin-kwin/trunk/deepin-kwin-crash.patch
Modified:
  deepin-kwin/trunk/PKGBUILD
  deepin-kwin/trunk/deepin-kwin-unload-blur.patch

-------------------------------+
 PKGBUILD                      |   11 ++--
 deepin-kwin-crash.patch       |   39 ++++++++++++++++
 deepin-kwin-unload-blur.patch |   96 +++++++++++++++++++++++-----------------
 3 files changed, 103 insertions(+), 43 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-12-15 10:06:22 UTC (rev 775919)
+++ PKGBUILD	2020-12-15 10:07:25 UTC (rev 775920)
@@ -4,7 +4,7 @@
 
 pkgname=deepin-kwin
 pkgver=5.2.0.11
-pkgrel=1
+pkgrel=2
 pkgdesc='KWin configures on DDE'
 arch=('x86_64')
 url="https://github.com/linuxdeepin/dde-kwin"
@@ -14,11 +14,13 @@
 source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/dde-kwin/archive/$pkgver.tar.gz"
         $pkgname-tabbox-chameleon-rename.patch::https://github.com/linuxdeepin/dde-kwin/pull/106.patch
         $pkgname-unload-blur.patch
-        $pkgname-added-functions-from-their-forked-kwin.patch)
+        $pkgname-added-functions-from-their-forked-kwin.patch
+        $pkgname-crash.patch)
 sha512sums=('1d845d18d05a81346f7f0870b5dba21c00615c83a3925855fab2d7f6bec61c73f446e8c7c92346dfd21f195adec88dfffd4272569c933725bd1c8aa156482aee'
             '7ac1a577868b73314274d336287334acc5bf4ac06dde046c93e4c2d3f68a112389c8b0644d1cbc3fde5ba1c01f368676f4f34b4a1b7b6c97a5b73d66507d134d'
-            '9c5bf86510d0fbba36e71997f55eda1b197b26af7eeb0adb9e06e7e3cc86b32c00cd23dfca872f4043f76a1d9435f916aae73536f10c7b3fe7e79a6e74a309d2'
-            '48a3bead1c7cde1261f5f710fd055c52f061320999064ba4cc96a81f9b0770ea2a8fba7aff37d20bb7671b219c38bf8424f24fd7742d36b3c6bf171d3874c1f4')
+            '26d6cc86578c07288233793ebeaa894b6eab6f317344b41e8a76a7438c429a2ae5075b08fcf1c7cf236f81fb51252e29aea3fefbfcfa46ad83059abe2630c185'
+            '48a3bead1c7cde1261f5f710fd055c52f061320999064ba4cc96a81f9b0770ea2a8fba7aff37d20bb7671b219c38bf8424f24fd7742d36b3c6bf171d3874c1f4'
+            '73aef1435c83aec18f4535cc121d09121c1fb180f02b11fc57bb61339b79667ae310a4e3eb33263d6ba218b2eab7281dc9014578edf1317226239e8538e08830')
 
 prepare() {
   cd dde-kwin-$pkgver
@@ -26,6 +28,7 @@
   patch -R -p1 -i ../$pkgname-added-functions-from-their-forked-kwin.patch
   patch -p1 -i ../$pkgname-tabbox-chameleon-rename.patch
   patch -p1 -i ../$pkgname-unload-blur.patch
+  patch -p1 -i ../$pkgname-crash.patch
 
   # https://github.com/linuxdeepin/dde-kwin/issues/127
   sed -i '/m_blurManager->create/d' plugins/kwineffects/blur/blur.cpp

Added: deepin-kwin-crash.patch
===================================================================
--- deepin-kwin-crash.patch	                        (rev 0)
+++ deepin-kwin-crash.patch	2020-12-15 10:07:25 UTC (rev 775920)
@@ -0,0 +1,39 @@
+diff --git a/plugins/platforms/lib/kwinutils.cpp b/plugins/platforms/lib/kwinutils.cpp
+index 4f2f7c58a..d022392ea 100644
+--- a/plugins/platforms/lib/kwinutils.cpp
++++ b/plugins/platforms/lib/kwinutils.cpp
+@@ -148,6 +148,12 @@ public:
+     static Cursor *s_self;
+ };
+ 
++class Cursors : public QObject
++{
++public:
++    static Cursors *s_self;
++};
++
+ class AbstractClient : public QObject {};
+ class Options {
+ public:
+@@ -606,7 +612,21 @@ QObject *KWinUtils::tabBox()
+ 
+ QObject *KWinUtils::cursor()
+ {
++#if defined(KWIN_VERSION) && KWIN_VERSION <= KWIN_VERSION_CHECK(5, 18, 4, 0)
+     return KWin::Cursor::s_self;
++#else
++    /*
++     * kwin:6abd23ed0220b14a4a05fa280869ba3c953565e3
++     * Make it possible to have a separate cursor for the tablet
++     * Summary:
++     * As is KWin only had 1 Cursor which was a singleton. This made it impossible for
++     * us to properly implement the tablet (as in drawing tablets) support and show where
++     * we're drawing.
++     * This patch makes it possible to have different Cursors in KWin, it makes all the
++     * current code still follow the mouse but the tablet can still render a cursor.
++     */
++    return KWin::Cursors::s_self;
++#endif
+ }
+ 
+ QObject *KWinUtils::virtualDesktop()

Modified: deepin-kwin-unload-blur.patch
===================================================================
--- deepin-kwin-unload-blur.patch	2020-12-15 10:06:22 UTC (rev 775919)
+++ deepin-kwin-unload-blur.patch	2020-12-15 10:07:25 UTC (rev 775920)
@@ -1,18 +1,19 @@
-From 2a1753972eac4345e864d6f4ec795a9fda48fda1 Mon Sep 17 00:00:00 2001
-From: Felix Yan <felixonmars at archlinux.org>
-Date: Sun, 17 May 2020 23:46:26 +0800
-Subject: [PATCH] fix: make sure kwin's builtin blur is unloaded
+From 72acb76a3ba65ed982f13ac12297e8d1411f7e43 Mon Sep 17 00:00:00 2001
+From: lxz <justforlxz at gmail.com>
+Date: Wed, 25 Nov 2020 20:23:17 +0800
+Subject: [PATCH] fix: unload kwin blur
 
+disable buildin blur effect
+
+Log:
+Change-Id: I98c8b2fc654a8fbc93e958a807928e492538120c
 ---
- plugins/kwineffects/blur/blur.cpp | 24 ++++++++++++++----------
- plugins/kwineffects/blur/blur.h   |  1 +
- 2 files changed, 15 insertions(+), 10 deletions(-)
 
 diff --git a/plugins/kwineffects/blur/blur.cpp b/plugins/kwineffects/blur/blur.cpp
-index b5cae9e..6f38429 100644
+index 9a92921..6f5040c 100644
 --- a/plugins/kwineffects/blur/blur.cpp
 +++ b/plugins/kwineffects/blur/blur.cpp
-@@ -41,16 +41,7 @@ static const QByteArray s_blurAtomName = QByteArrayLiteral("_KDE_NET_WM_BLUR_BEH
+@@ -48,17 +48,6 @@
  
  BlurEffect::BlurEffect(QObject *, const QVariantList &)
  {
@@ -26,41 +27,58 @@
 -            QMetaObject::invokeMethod(effects, "unloadEffect", Qt::DirectConnection, Q_ARG(QString, "blur"));
 -        }
 -    }
-+    unloadBuiltinBlur();
- 
+-
      m_shader = new BlurShader(this);
  
-@@ -687,8 +678,21 @@ void BlurEffect::generateNoiseTexture()
-     m_noiseTexture.setWrapMode(GL_REPEAT);
+     initBlurStrengthValues();
+diff --git a/plugins/platforms/plugin/libkwinpreload.cpp b/plugins/platforms/plugin/libkwinpreload.cpp
+index 4f5f89b..8d23fa2 100644
+--- a/plugins/platforms/plugin/libkwinpreload.cpp
++++ b/plugins/platforms/plugin/libkwinpreload.cpp
+@@ -36,6 +36,7 @@
+ #include <QStyleFactory>
+ #include <QStyle>
+ #include <QTimer>
++#include <QLibrary>
+ 
+ // deepin dbus menu
+ #define MenuDBusService "com.deepin.menu"
+@@ -275,6 +276,18 @@
+     }
  }
  
-+void BlurEffect::unloadBuiltinBlur()
-+// 禁用kwin自己的模糊特效,防止两个特效之间出现冲突
-+{
-+    bool blur_loaded = false;
-+    QMetaObject::invokeMethod(effects, "isEffectLoaded", Qt::DirectConnection, Q_RETURN_ARG(bool, blur_loaded), Q_ARG(QString, "blur"));
++namespace BuiltInEffects {
++bool supported(BuiltInEffect effect) {
++    if (effect == BuiltInEffect::Blur) {
++        return false;
++    }
 +
-+    if (blur_loaded) {
-+        qWarning() << "will try unload builtIn blur effect of kwin";
-+        QMetaObject::invokeMethod(effects, "unloadEffect", Qt::DirectConnection, Q_ARG(QString, "blur"));
-+    }
++    typedef bool (*ClientBuiltInEffect)(KWin::BuiltInEffect);
++    static ClientBuiltInEffect clientBuildInEffect = (ClientBuiltInEffect)QLibrary::resolve("kwin.so", qApp->applicationVersion(), "_ZN4KWin14BuiltInEffects9supportedENS_13BuiltInEffectE");
++    return clientBuildInEffect ? clientBuildInEffect(effect) : false;
 +}
++}
 +
- void BlurEffect::doBlur(const QRegion& shape, const QRect& screen, const float opacity, const QMatrix4x4 &screenProjection, bool isDock, QRect windowRect)
- {
-+    unloadBuiltinBlur();
-     // Blur would not render correctly on a secondary monitor because of wrong coordinates
-     // BUG: 393723
-     const int xTranslate = -screen.x();
-diff --git a/plugins/kwineffects/blur/blur.h b/plugins/kwineffects/blur/blur.h
-index 7c76a82..ac0c21e 100644
---- a/plugins/kwineffects/blur/blur.h
-+++ b/plugins/kwineffects/blur/blur.h
-@@ -88,6 +88,7 @@ public Q_SLOTS:
-     void uploadRegion(QVector2D *&map, const QRegion &region, const int downSampleIterations);
-     void uploadGeometry(GLVertexBuffer *vbo, const QRegion &blurRegion, const QRegion &windowRegion);
-     void generateNoiseTexture();
-+    void unloadBuiltinBlur();
+ #endif // USE_DBUS_MENU
+ } // namespace KWin
  
-     void upscaleRenderToScreen(GLVertexBuffer *vbo, int vboStart, int blurRectCount, QMatrix4x4 screenProjection, QPoint windowPosition);
-     void downSampleTexture(GLVertexBuffer *vbo, int blurRectCount);
+diff --git a/plugins/platforms/plugin/libkwinpreload.h b/plugins/platforms/plugin/libkwinpreload.h
+index 03cd475..9b60ba6 100644
+--- a/plugins/platforms/plugin/libkwinpreload.h
++++ b/plugins/platforms/plugin/libkwinpreload.h
+@@ -62,6 +62,15 @@
+ };
+ 
+ #endif // USE_DBUS_MENU
++
++enum class BuiltInEffect {
++    InValid,
++    Blur,
++};
++
++namespace BuiltInEffects {
++    bool supported(BuiltInEffect effect);
++}
+ }
+ 
+ #if !defined(KWIN_VERSION) || KWIN_VERSION <= KWIN_VERSION_CHECK(5, 8, 6, 0)



More information about the arch-commits mailing list