!8 [sync] PR-7: update version to 5.4.26

From: @openeuler-sync-bot 
Reviewed-by: @yeqinglong01 
Signed-off-by: @yeqinglong01
This commit is contained in:
openeuler-ci-bot 2022-08-02 01:01:20 +00:00 committed by Gitee
commit 12dbf3bb9c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 1057 additions and 82 deletions

View File

@ -0,0 +1,134 @@
From b9138794ca476a3e533c0f49041a436e15b66eae Mon Sep 17 00:00:00 2001
From: Robin Lee <cheeselee@fedoraproject.org>
Date: Fri, 22 Apr 2022 11:17:36 +0800
Subject: [PATCH] revert added functions from their forked kwin
---
deepin-wm-dbus/com.deepin.wm.xml.in | 6 ------
deepin-wm-dbus/deepinwmfaker.cpp | 14 --------------
deepin-wm-dbus/deepinwmfaker.h | 2 --
plugins/platforms/lib/kwinutils.cpp | 18 ------------------
plugins/platforms/lib/kwinutils.h | 2 --
.../plugin/org.kde.kwin.KWinUtils.xml | 6 ------
6 files changed, 48 deletions(-)
diff --git a/deepin-wm-dbus/com.deepin.wm.xml.in b/deepin-wm-dbus/com.deepin.wm.xml.in
index a73a88632..279ebca4a 100644
--- a/deepin-wm-dbus/com.deepin.wm.xml.in
+++ b/deepin-wm-dbus/com.deepin.wm.xml.in
@@ -175,10 +175,4 @@
<method name="SetShowDesktop">
<arg type="b" name="isShowDesktop" direction="in"/>
</method>
- <method name="TouchToMove">
- <arg type="i" name="x" direction="in"/>
- <arg type="i" name="y" direction="in"/>
- </method>
- <method name="ClearMoveStatus">
- </method>
</interface>
diff --git a/deepin-wm-dbus/deepinwmfaker.cpp b/deepin-wm-dbus/deepinwmfaker.cpp
index f026a8f23..1e0ddf645 100644
--- a/deepin-wm-dbus/deepinwmfaker.cpp
+++ b/deepin-wm-dbus/deepinwmfaker.cpp
@@ -911,20 +911,6 @@ void DeepinWMFaker::BeginToMoveActiveWindow()
m_kwinUtilsInter->WindowMove();
}
-void DeepinWMFaker::TouchToMove(int x, int y)
-{
-#ifndef DISABLE_DEEPIN_WM
- m_kwinUtilsInter->TouchPadToMoveWindow(x,y);
-#endif
-}
-
-void DeepinWMFaker::ClearMoveStatus()
-{
-#ifndef DISABLE_DEEPIN_WM
- m_kwinUtilsInter->EndTouchPadToMoveWindow();
-#endif
-}
-
void DeepinWMFaker::SwitchApplication(bool backward)
{
if (!m_kwinUtilsInter->isValid()) {
diff --git a/deepin-wm-dbus/deepinwmfaker.h b/deepin-wm-dbus/deepinwmfaker.h
index f44edc7fd..f6f7dd40b 100644
--- a/deepin-wm-dbus/deepinwmfaker.h
+++ b/deepin-wm-dbus/deepinwmfaker.h
@@ -133,8 +133,6 @@ public Q_SLOTS:
bool GetIsShowDesktop();
void SetShowDesktop(bool isShowDesktop);
- void TouchToMove(int x, int y);
- void ClearMoveStatus();
Q_SIGNALS:
void WorkspaceBackgroundChanged(int index, const QString &newUri);
void WorkspaceBackgroundChangedForMonitor(int index, const QString &strMonitorName, const QString &newUri);
diff --git a/plugins/platforms/lib/kwinutils.cpp b/plugins/platforms/lib/kwinutils.cpp
index ee283a60e..cfa0e1b0f 100644
--- a/plugins/platforms/lib/kwinutils.cpp
+++ b/plugins/platforms/lib/kwinutils.cpp
@@ -92,8 +92,6 @@ public Q_SLOTS:
// change to Compositor::compositing()
bool compositing() const;
#endif
- void slotTouchPadTomoveWindow(int x, int y);
- void slotEndTouchPadToMoveWindow();
#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 10, 95, 0)
// kwin < 5.10.95
@@ -1129,22 +1127,6 @@ void KWinUtils::WindowMove()
}
}
-void KWinUtils::TouchPadToMoveWindow(int x, int y)
-{
- KWin::Workspace *ws = static_cast<KWin::Workspace *>(workspace());
- if (ws) {
- ws->slotTouchPadTomoveWindow(x,y);
- }
-}
-
-void KWinUtils::EndTouchPadToMoveWindow()
-{
- KWin::Workspace *ws = static_cast<KWin::Workspace *>(workspace());
- if (ws) {
- ws->slotEndTouchPadToMoveWindow();
- }
-}
-
void KWinUtils::WindowMaximize()
{
KWin::Workspace *ws = static_cast<KWin::Workspace *>(workspace());
diff --git a/plugins/platforms/lib/kwinutils.h b/plugins/platforms/lib/kwinutils.h
index ca2919bb2..d41754300 100644
--- a/plugins/platforms/lib/kwinutils.h
+++ b/plugins/platforms/lib/kwinutils.h
@@ -166,8 +166,6 @@ public Q_SLOTS:
void ShowWindowsView();
void ResumeCompositor(int type);
void SuspendCompositor(int type);
- void TouchPadToMoveWindow(int x, int y);
- void EndTouchPadToMoveWindow();
Q_SIGNALS:
void initialized();
diff --git a/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml b/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml
index 5854ed04f..aa61b6cde 100644
--- a/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml
+++ b/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml
@@ -22,10 +22,4 @@
<method name="SuspendCompositor">
<arg type="i" name="type" direction="in"/>
</method>
- <method name="TouchPadToMoveWindow">
- <arg type="i" name="x" direction="in"/>
- <arg type="i" name="y" direction="in"/>
- </method>
- <method name="EndTouchPadToMoveWindow">
- </method>
</interface>
--
2.34.1

Binary file not shown.

BIN
dde-kwin-5.4.26.tar.gz Normal file

Binary file not shown.

805
dde-kwin.5.4.26.patch Normal file
View File

@ -0,0 +1,805 @@
commit df1937194c07b850425bd047ed4fc8a8986b0609
Author: justforlxz <justforlxz@gmail.com>
Date: Wed Apr 6 20:24:55 2022 +0800
refactor: scissor-window
Adapt to kwin 4.24
Log: Adapt to kwin 4.24
Change-Id: I5da82f2b20cfc6ed165e2e0559fa556624de1d77
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cbbf79e0c..60c2f3cd8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,26 @@ add_definitions(
-DPROJECT_VERSION=\\"${PROJECT_VERSION}\\"
)
+option(USE_PLUGINS "use dde-kwin plugins" ON)
+option(USE_SCRIPTS "use scripts" ON)
+option(USE_DEEPIN_WM_DBUS "use deepin-wm dbus service" ON)
+option(USE_TABBOX "use deepin style tabbox" ON)
+option(USE_WINDOW_TOOL "support wayland and x11" ON)
+option(USE_DEEPIN_WAYLAND "use deepin wayland" ON)
+option(USE_KWIN_NO_SCALE "use kwin_no_scale script" ON)
+option(ENABLE_BUILTIN_SCISSOR_WINDOW "enable deepin built-in scissor window plugin" ON)
+option(ENABLE_BUILTIN_BLUR "enable deepin built-in blur plugin" ON)
+option(ENABLE_BUILTIN_MULTITASKING "enable deepin built-in multitasking plugin" ON)
+option(ENABLE_BUILTIN_BLACK_SCREEN "enable deepin built-in black screen plugin" ON)
+
+if(ENABLE_BUILTIN_BLUR)
+ add_definitions(-DENABLE_BUILTIN_BLUR)
+endif(ENABLE_BUILTIN_BLUR)
+
+if (USE_DEEPIN_WAYLAND)
+ add_definitions(-DUSE_DEEPIN_WAYLAND)
+endif(USE_DEEPIN_WAYLAND)
+
#when "KWIN_VERSION > KWIN_VERSION_CHECK(5, 18, 90, 0)"
find_path(
KWaylandServerPath
@@ -91,14 +111,28 @@ if (KWIN_VERSION)
)
endif()
-add_subdirectory(configures)
-set(DDE_KWIN_SUPPORTED_VERSION "5.21.5")
-if (${KWIN_VERSION} STRLESS ${DDE_KWIN_SUPPORTED_VERSION} OR ${KWIN_VERSION} STREQUAL ${DDE_KWIN_SUPPORTED_VERSION})
- add_subdirectory(plugins)
- add_subdirectory(scripts)
- add_subdirectory(deepin-wm-dbus)
- add_subdirectory(tabbox)
- if (BUILD_TESTING)
- add_subdirectory(tests)
- endif()
+if (USE_PLUGINS)
+ add_subdirectory(plugins)
+endif()
+
+if (USE_SCRIPTS)
+ add_subdirectory(scripts)
+endif()
+
+if (USE_DEEPIN_WM_DBUS)
+ add_subdirectory(deepin-wm-dbus)
endif()
+
+if (USE_TABBOX)
+add_subdirectory(tabbox)
+endif()
+
+if (BUILD_TESTING)
+ add_subdirectory(tests)
+endif()
+
+if (USE_WINDOW_TOOL)
+ add_subdirectory(windowtool)
+endif()
+
+add_subdirectory(configures)
diff --git a/configures/CMakeLists.txt b/configures/CMakeLists.txt
index 4ac0a906d..99e0d0970 100644
--- a/configures/CMakeLists.txt
+++ b/configures/CMakeLists.txt
@@ -1,9 +1,17 @@
configure_file(kwin_no_scale.in kwin_no_scale)
+if(ENABLE_BUILTIN_BLUR)
+ set(ENABLE_BUILTIN_BLUR_STRING "false")
+ else()
+ set(ENABLE_BUILTIN_BLUR_STRING "true")
+ endif()
+
+configure_file(kwinrc.in kwinrc)
+
install(
FILES
kglobalshortcutsrc
- kwinrc
+ ${CMAKE_CURRENT_BINARY_DIR}/kwinrc
kwinrulesrc
klaunchrc
kdeglobals
@@ -11,4 +19,9 @@ install(
"/etc/xdg"
)
-install_files("/bin" FILES ${CMAKE_CURRENT_BINARY_DIR}/kwin_no_scale)
+if (USE_KWIN_NO_SCALE)
+ configure_file(kwin_no_scale.in kwin_no_scale)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kwin_no_scale
+ DESTINATION bin
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+endif()
diff --git a/configures/kwin_no_scale.in b/configures/kwin_no_scale.in
old mode 100755
new mode 100644
index d34aba1f7..8b4a5b18a
--- a/configures/kwin_no_scale.in
+++ b/configures/kwin_no_scale.in
@@ -1,20 +1,19 @@
-#!/bin/sh
-
-KWIN_VERSION=`kwin_x11 --version 2>/dev/null`
-DDE_KWIN_SUPPORTED_VERSION='kwin 5.21.5'
-if [ "$KWIN_VERSION" \> "$DDE_KWIN_SUPPORTED_VERSION" ]; then
- kwin_x11 $@
- exit 0
-fi
+#!/bin/bash
if [ -n "$HOME" ];then
cp -n /etc/xdg/kglobalshortcutsrc $HOME/.config/kglobalshortcutsrc
fi
-EXECUTE_PATH=$(cd `dirname $0`; pwd)
+ARGS=$@
+
+function runDeepinKWin() {
+ local EXECUTE_PATH=$1
+ export LD_PRELOAD=${PLUGIN_INSTALL_PATH}/libdde-kwin-xcb.so:$LD_PRELOAD
+ export QT_SCALE_FACTOR=1
+ #":"后的"appFilePath=..."会传递给QPlatformIntegration::create调用
+ # appFilePath 的值会覆盖 QCoreApplication::applicationPath以确保kwin崩溃自动重启时也是启动的kwin_no_scale脚本
+ kwin_x11 -platform dde-kwin-xcb:appFilePath=$EXECUTE_PATH/kwin_no_scale $ARGS
+ return $?
+}
-export "LD_PRELOAD=${PLUGIN_INSTALL_PATH}/libdde-kwin-xcb.so:$LD_PRELOAD"
-export QT_SCALE_FACTOR=1
-#":"后的"appFilePath=..."会传递给QPlatformIntegration::create调用
-# appFilePath 的值会覆盖 QCoreApplication::applicationPath以确保kwin崩溃自动重启时也是启动的kwin_no_scale脚本
-kwin_x11 -platform dde-kwin-xcb:appFilePath=$EXECUTE_PATH/kwin_no_scale $@
+runDeepinKWin "$(cd `dirname $0`; pwd)" || kwin_x11 $ARGS
diff --git a/configures/kwinrc b/configures/kwinrc.in
similarity index 98%
rename from configures/kwinrc
rename to configures/kwinrc.in
index c1fde055b..3d73073e5 100644
--- a/configures/kwinrc
+++ b/configures/kwinrc.in
@@ -1,6 +1,6 @@
[Plugins]
#默认使用com.deepin.blur
-blurEnabled=false
+blurEnabled=@ENABLE_BUILTIN_BLUR_STRING@
enforcedecoEnabled=false
minimizeallEnabled=true
kwin4_effect_dialogparentEnabled=false
diff --git a/deepin-wm-dbus/CMakeLists.txt b/deepin-wm-dbus/CMakeLists.txt
index 3312af1d9..3807bc8f9 100644
--- a/deepin-wm-dbus/CMakeLists.txt
+++ b/deepin-wm-dbus/CMakeLists.txt
@@ -3,6 +3,7 @@ set(TARGET_NAME "deepin-wm-dbus")
find_package(Qt5Core REQUIRED)
find_package(Qt5DBus REQUIRED)
+find_package(X11 REQUIRED)
find_package(KF5Config REQUIRED)
find_package(KF5WindowSystem REQUIRED)
find_package(KF5GlobalAccel REQUIRED)
diff --git a/plugins/kdecoration/CMakeLists.txt b/plugins/kdecoration/CMakeLists.txt
index 0a34ea25d..60196cf37 100644
--- a/plugins/kdecoration/CMakeLists.txt
+++ b/plugins/kdecoration/CMakeLists.txt
@@ -5,6 +5,7 @@ add_definitions(-DTARGET_NAME=\\"${TARGET_NAME}\\")
find_package(Qt5 CONFIG REQUIRED COMPONENTS Core)
find_package(KF5CoreAddons REQUIRED)
find_package(Qt5DBus REQUIRED)
+find_package(X11 REQUIRED)
find_package(KF5Config REQUIRED)
find_package(KF5WindowSystem REQUIRED)
find_package(KDecoration2 REQUIRED)
diff --git a/plugins/kdecoration/chameleon.cpp b/plugins/kdecoration/chameleon.cpp
index 6896edbde..289b9c3cc 100644
--- a/plugins/kdecoration/chameleon.cpp
+++ b/plugins/kdecoration/chameleon.cpp
@@ -80,6 +80,7 @@ void Chameleon::init()
updateTheme();
if (!QX11Info::isPlatformX11() && m_client) {
+#ifdef USE_DEEPIN_WAYLAND
m_ddeShellSurface = static_cast<KWayland::Server::DDEShellSurfaceInterface*>(KWinUtils::getDDEShellSurface(m_client));
if (m_ddeShellSurface) {
connect(m_ddeShellSurface, &KWayland::Server::DDEShellSurfaceInterface::noTitleBarPropertyRequested, this,
@@ -102,6 +103,7 @@ void Chameleon::init()
}
);
}
+#endif
}
connect(global_config, &ChameleonConfig::themeChanged, this, &Chameleon::updateTheme);
diff --git a/plugins/kdecoration/chameleon.h b/plugins/kdecoration/chameleon.h
index 6bfde0b16..4eed1e543 100644
--- a/plugins/kdecoration/chameleon.h
+++ b/plugins/kdecoration/chameleon.h
@@ -33,7 +33,11 @@
#include <QSettings>
#include <QScreen>
#include <QPainterPath>
+#include <QFont>
+
+#ifdef USE_DEEPIN_WAYLAND
#include <KWayland/Server/ddeshell_interface.h>
+#endif
class Settings;
class ChameleonWindowTheme;
@@ -124,7 +128,10 @@ private:
QPointer<KWin::EffectWindow> m_effect;
QFont m_font;
+
+#ifdef USE_DEEPIN_WAYLAND
KWayland::Server::DDEShellSurfaceInterface * m_ddeShellSurface = nullptr;
+#endif
};
#endif // CHAMELEON_H
diff --git a/plugins/kdecoration/chameleonconfig.cpp b/plugins/kdecoration/chameleonconfig.cpp
index 8b6a03b8e..3a12e93a1 100644
--- a/plugins/kdecoration/chameleonconfig.cpp
+++ b/plugins/kdecoration/chameleonconfig.cpp
@@ -141,7 +141,7 @@ void ChameleonConfig::onConfigChanged()
}
#define D_KWIN_DEBUG_APP_START_TIME "D_KWIN_DEBUG_APP_START_TIME"
-void ChameleonConfig::onClientAdded(KWin::Client *client)
+void ChameleonConfig::onClientAdded(KWin::AbstractClient *client)
{
QObject *c = reinterpret_cast<QObject*>(client);
@@ -905,7 +905,7 @@ void ChameleonConfig::init()
{
#ifndef DISBLE_DDE_KWIN_XCB
connect(KWinUtils::workspace(), SIGNAL(configChanged()), this, SLOT(onConfigChanged()));
- connect(KWinUtils::workspace(), SIGNAL(clientAdded(KWin::Client*)), this, SLOT(onClientAdded(KWin::Client*)));
+ connect(KWinUtils::workspace(), SIGNAL(clientAdded(KWin::AbstractClient*)), this, SLOT(onClientAdded(KWin::AbstractClient*)));
connect(KWinUtils::workspace(), SIGNAL(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(onUnmanagedAdded(KWin::Unmanaged*)));
connect(KWinUtils::compositor(), SIGNAL(compositingToggled(bool)), this, SLOT(onCompositingToggled(bool)));
connect(KWinUtils::instance(), &KWinUtils::windowPropertyChanged, this, &ChameleonConfig::onWindowPropertyChanged);
@@ -1225,7 +1225,11 @@ void ChameleonConfig::buildKWinX11Shadow(QObject *window)
effect = window->findChild<KWin::EffectWindow*>(QString(), Qt::FindDirectChildrenOnly);
if (effect) {
- QRect shape_rect = effect->shape().boundingRect();
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
+ QRect shape_rect = effect->geometry();
+#else
+ QRect shape_rect = effect->clientGeometry();
+#endif
const QRect window_rect(QPoint(0, 0), window->property("size").toSize());
// 减去窗口的shape区域
diff --git a/plugins/kdecoration/chameleonconfig.h b/plugins/kdecoration/chameleonconfig.h
index b9408267e..be5a48b9a 100644
--- a/plugins/kdecoration/chameleonconfig.h
+++ b/plugins/kdecoration/chameleonconfig.h
@@ -38,7 +38,7 @@
#define _NET_WM_WINDOW_TYPE "_NET_WM_WINDOW_TYPE"
namespace KWin {
-class Client;
+class AbstractClient;
class Unmanaged;
class EffectWindow;
class Toplevel;
@@ -93,7 +93,7 @@ protected:
private slots:
void onConfigChanged();
- void onClientAdded(KWin::Client *client);
+ void onClientAdded(KWin::AbstractClient *client);
// 针对X11BypassWindowManagerHint类型的窗口需要做一些特殊处理
void onUnmanagedAdded(KWin::Unmanaged *client);
void onCompositingToggled(bool active);
diff --git a/plugins/kwineffects/CMakeLists.txt b/plugins/kwineffects/CMakeLists.txt
index 9832df92a..5a6036896 100644
--- a/plugins/kwineffects/CMakeLists.txt
+++ b/plugins/kwineffects/CMakeLists.txt
@@ -1,10 +1,22 @@
find_package(Qt5 CONFIG REQUIRED COMPONENTS Core Gui)
+find_package(X11 REQUIRED)
find_package(KF5CoreAddons REQUIRED)
find_package(KF5WindowSystem REQUIRED)
set(INSTALL_PATH "${QT_INSTALL_PLUGINS}/kwin/effects/plugins")
-add_subdirectory(scissor-window)
-add_subdirectory(blur)
-add_subdirectory(multitasking)
-add_subdirectory(black-screen)
+if (ENABLE_BUILTIN_SCISSOR_WINDOW)
+ add_subdirectory(scissor-window)
+endif()
+
+if (ENABLE_BUILTIN_BLUR)
+ add_subdirectory(blur)
+endif()
+
+if (ENABLE_BUILTIN_MULTITASKING)
+ add_subdirectory(multitasking)
+endif()
+
+if (ENABLE_BUILTIN_BLACK_SCREEN)
+ add_subdirectory(black-screen)
+endif()
diff --git a/plugins/kwineffects/scissor-window/cornermask.frag.140 b/plugins/kwineffects/scissor-window/cornermask.frag
similarity index 100%
rename from plugins/kwineffects/scissor-window/cornermask.frag.140
rename to plugins/kwineffects/scissor-window/cornermask.frag
diff --git a/plugins/kwineffects/scissor-window/cornermask.frag.110 b/plugins/kwineffects/scissor-window/cornermask_core.frag
similarity index 100%
rename from plugins/kwineffects/scissor-window/cornermask.frag.110
rename to plugins/kwineffects/scissor-window/cornermask_core.frag
diff --git a/plugins/kwineffects/scissor-window/fullmask.frag.140 b/plugins/kwineffects/scissor-window/fullmask.frag
similarity index 100%
rename from plugins/kwineffects/scissor-window/fullmask.frag.140
rename to plugins/kwineffects/scissor-window/fullmask.frag
diff --git a/plugins/kwineffects/scissor-window/fullmask.frag.110 b/plugins/kwineffects/scissor-window/fullmask_core.frag
similarity index 100%
rename from plugins/kwineffects/scissor-window/fullmask.frag.110
rename to plugins/kwineffects/scissor-window/fullmask_core.frag
diff --git a/plugins/kwineffects/scissor-window/glsl.qrc b/plugins/kwineffects/scissor-window/glsl.qrc
index 8b2ecb6f3..2e6bc448d 100644
--- a/plugins/kwineffects/scissor-window/glsl.qrc
+++ b/plugins/kwineffects/scissor-window/glsl.qrc
@@ -1,10 +1,16 @@
<RCC>
+ <qresource prefix="/">
+ <file>cornermask_core.frag</file>
+ <file>fullmask_core.frag</file>
+ <file>cornermask.frag</file>
+ <file>fullmask.frag</file>
+ </qresource>
<qresource prefix="/effect-shaders-1.10">
- <file alias="corner-mask.frag">cornermask.frag.110</file>
- <file alias="full-mask.frag">fullmask.frag.110</file>
+ <file alias="cornermask.frag">cornermask_core.frag</file>
+ <file alias="fullmask.frag">fullmask_core.frag</file>
</qresource>
<qresource prefix="/effect-shaders-1.40">
- <file alias="corner-mask.frag">cornermask.frag.140</file>
- <file alias="full-mask.frag">fullmask.frag.140</file>
+ <file alias="cornermask.frag">cornermask.frag</file>
+ <file alias="fullmask.frag">fullmask.frag</file>
</qresource>
</RCC>
diff --git a/plugins/kwineffects/scissor-window/main.cpp b/plugins/kwineffects/scissor-window/main.cpp
index 73544556c..8d9659e19 100644
--- a/plugins/kwineffects/scissor-window/main.cpp
+++ b/plugins/kwineffects/scissor-window/main.cpp
@@ -23,19 +23,27 @@
class ScissorWindowPluginFactory : public KWin::EffectPluginFactory
{
Q_OBJECT
- Q_INTERFACES(KPluginFactory)
+#if KWIN_VERSION_MAJ <= 5 && KWIN_VERSION_MIN < 23
Q_PLUGIN_METADATA(IID KPluginFactory_iid FILE "scissor-window.json")
-
+#else
+ Q_PLUGIN_METADATA(IID EffectPluginFactory_iid FILE "scissor-window.json")
+#endif
+ Q_INTERFACES(KPluginFactory)
public:
- explicit ScissorWindowPluginFactory();
- ~ScissorWindowPluginFactory();
+ explicit ScissorWindowPluginFactory() {}
+ ~ScissorWindowPluginFactory() {}
- KWin::Effect *createEffect() const {
- return ScissorWindow::supported() ? new ScissorWindow() : nullptr;
+ bool isSupported() const override {
+ return ScissorWindow::supported();
}
-};
-K_PLUGIN_FACTORY_DEFINITION(ScissorWindowPluginFactory, registerPlugin<ScissorWindow>();)
-K_EXPORT_PLUGIN_VERSION(KWIN_EFFECT_API_VERSION)
+ bool enabledByDefault() const override {
+ return true;
+ }
+
+ KWin::Effect *createEffect() const override {
+ return new ScissorWindow;
+ }
+};
#include "main.moc"
diff --git a/plugins/kwineffects/scissor-window/scissor-window.json b/plugins/kwineffects/scissor-window/scissor-window.json
index e2ebdc65d..56522ecd1 100644
--- a/plugins/kwineffects/scissor-window/scissor-window.json
+++ b/plugins/kwineffects/scissor-window/scissor-window.json
@@ -4,6 +4,10 @@
{
"Email": "zccrs@live.com",
"Name": "zccrs"
+ },
+ {
+ "Email": "lxz@mkacg.com",
+ "Name": "justforlxz"
}
],
"Description": "Allow clip of window content",
@@ -15,8 +19,15 @@
"ServiceTypes": [
"KWin/Effect"
],
- "org.kde.kwin.effect": {
- "exclusiveGroup": "appearance"
- }
- }
+ "Category": "Appearance",
+ "License": "GPL",
+ "Version": "1.0"
+ },
+ "org.kde.kwin.effect": {
+ "exclusiveGroup": "appearance",
+ "enabledByDefaultMethod": true
+ },
+ "X-KDE-Ordering": "5",
+ "X-Plasma-API": "",
+ "X-Plasma-MainScript": ""
}
diff --git a/plugins/kwineffects/scissor-window/scissorwindow.cpp b/plugins/kwineffects/scissor-window/scissorwindow.cpp
index a80118421..4785c1f22 100644
--- a/plugins/kwineffects/scissor-window/scissorwindow.cpp
+++ b/plugins/kwineffects/scissor-window/scissorwindow.cpp
@@ -19,10 +19,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scissorwindow.h"
-#ifndef DISBLE_DDE_KWIN_XCB
-#include "kwinutils.h"
-#endif
-
#include <kwinglutils.h>
#include <kwinglplatform.h>
#include <kwingltexture.h>
@@ -32,6 +28,7 @@
#include <QExplicitlySharedDataPointer>
#include <QSignalBlocker>
#include <QPainterPath>
+#include <QScopedPointer>
Q_DECLARE_METATYPE(QPainterPath)
@@ -178,16 +175,24 @@ ScissorWindow::ScissorWindow(QObject *, const QVariantList &)
: Effect()
{
// 构建用于窗口圆角特效的着色器
- m_shader = KWin::ShaderManager::instance()->generateShaderFromResources(KWin::ShaderTrait::MapTexture, QString(), "corner-mask.frag");
+#if KWIN_VERSION_MAJ <= 5 && KWIN_VERSION_MIN < 23
+ m_shader = KWin::ShaderManager::instance()->generateShaderFromResources(KWin::ShaderTrait::MapTexture, QString(), ":/cornermask.frag");
+#else
+ m_shader = KWin::ShaderManager::instance()->generateShaderFromFile(KWin::ShaderTrait::MapTexture, QString(), ":/cornermask.frag");
+#endif
// 构建用于自定义窗口形状的着色器
- m_fullMaskShader = KWin::ShaderManager::instance()->generateShaderFromResources(KWin::ShaderTrait::MapTexture, QString(), "full-mask.frag");
+#if KWIN_VERSION_MAJ <= 5 && KWIN_VERSION_MIN < 23
+ m_fullMaskShader = KWin::ShaderManager::instance()->generateShaderFromResources(KWin::ShaderTrait::MapTexture, QString(), ":/fullmask.frag");
+#else
+ m_fullMaskShader = KWin::ShaderManager::instance()->generateShaderFromFile(KWin::ShaderTrait::MapTexture, QString(), ":/fullmask.frag");
+#endif
if (!m_shader->isValid()) {
- // qWarning() << Q_FUNC_INFO << "Invalid fragment shader of corner mask";
+ qWarning() << Q_FUNC_INFO << "Invalid fragment shader of corner mask";
}
if (!m_fullMaskShader->isValid()) {
- // qWarning() << Q_FUNC_INFO << "Invalid fragment shader of full mask";
+ qWarning() << Q_FUNC_INFO << "Invalid fragment shader of full mask";
}
}
@@ -205,6 +210,10 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
return Effect::drawWindow(w, mask, region, data);
}
+ if (KWin::effects->hasActiveFullScreenEffect() || w->isFullScreen()) {
+ return Effect::drawWindow(w, mask, region, data);
+ }
+
MaskCache::TextureData mask_texture = MaskCache::instance()->getTextureByWindow(w);
if (!mask_texture) {
@@ -214,7 +223,11 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
QRegion corner_region;
if (!mask_texture->customMask) {
+#if KWIN_VERSION_MAJ <= 5 && KWIN_VERSION_MIN < 23
const QRect window_rect = w->geometry();
+#else
+ const QRect window_rect = w->frameGeometry();
+#endif
QRect corner_rect(window_rect.topLeft(), mask_texture->size);
// top left
@@ -241,6 +254,7 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
}
}
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
KWin::WindowQuadList decoration_quad_list;
KWin::WindowQuadList content_quad_list;
@@ -257,20 +271,65 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
break;
}
}
+#endif
+#ifndef DISBLE_DDE_KWIN_XCB
+ class SetWindowDepth {
+ public:
+ SetWindowDepth(KWin::EffectWindow *w, int depth)
+ : m_window(w)
+ {
+ // 此时正在进行窗口绘制会有大量的调用应当避免窗口发射hasAlphaChanged信号
+ QSignalBlocker(w->parent());
+ KWinUtils::setClientDepth(w->parent(), depth);
+ }
+
+ ~SetWindowDepth() {
+ bool ok = false;
+ int depth = m_window->data(WindowDepthRole).toInt(&ok);
+ QObject *client = m_window->parent();
+
+ if (!ok) {
+ depth = KWinUtils::getWindowDepth(client);
+ // 保存以便下次使用
+ m_window->setData(WindowDepthRole, depth);
+ }
+
+ // 此时正在进行窗口绘制会有大量的调用应当避免窗口发射hasAlphaChanged信号
+ QSignalBlocker blocker(client);
+ Q_UNUSED(blocker)
+ KWinUtils::setClientDepth(client, depth);
+ }
+
+ private:
+ KWin::EffectWindow *m_window;
+ };
+
+ // 要想窗口裁剪生效必须要保证窗口材质绘制时开启了alpha通道混合
+ QScopedPointer<SetWindowDepth> setDepth;
+ if (!w->hasAlpha()) {
+ QScopedPointer<SetWindowDepth> alpha(new SetWindowDepth(w, 32));
+ setDepth.swap(alpha);
+ }
+ #endif
+
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
if (!mask_texture->customMask) {
// 此时只允许绘制窗口边框和阴影
// 针对设置了自定义裁剪的窗口,则不绘制标题栏和阴影
data.quads = decoration_quad_list;
Effect::drawWindow(w, mask, region, data);
}
+#endif
if (!corner_region.isEmpty()) {
QRegion new_region = region - corner_region;
// 先绘制未处于mask区域的窗口材质
if (!new_region.isEmpty()) {
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
data.quads = content_quad_list;
+#endif
Effect::drawWindow(w, mask, new_region, data);
}
@@ -278,6 +337,9 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
region = region - new_region;
}
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
// 将mask材质绑定到第二个材质
glActiveTexture(GL_TEXTURE1);
mask_texture->bind();
@@ -303,52 +365,13 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
// 此时只允许绘制窗口内容
auto old_shader = data.shader;
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
data.quads = content_quad_list;
+ data.quads = content_quad_list;
+#endif
data.shader = shader;
-#ifndef DISBLE_DDE_KWIN_XCB
- class SetWindowDepth {
- public:
- SetWindowDepth(KWin::EffectWindow *w, int depth)
- : m_window(w)
- {
- // 此时正在进行窗口绘制会有大量的调用应当避免窗口发射hasAlphaChanged信号
- QSignalBlocker blocker(w->parent());
- Q_UNUSED(blocker)
- KWinUtils::setClientDepth(w->parent(), depth);
- }
-
- ~SetWindowDepth() {
- bool ok = false;
- int depth = m_window->data(WindowDepthRole).toInt(&ok);
- QObject *client = m_window->parent();
-
- if (!ok) {
- depth = KWinUtils::getWindowDepth(client);
- // 保存以便下次使用
- m_window->setData(WindowDepthRole, depth);
- }
-
- // 此时正在进行窗口绘制会有大量的调用应当避免窗口发射hasAlphaChanged信号
- QSignalBlocker blocker(client);
- Q_UNUSED(blocker)
- KWinUtils::setClientDepth(client, depth);
- }
-
- private:
- KWin::EffectWindow *m_window;
- };
-
- // 要想窗口裁剪生效必须要保证窗口材质绘制时开启了alpha通道混合
- if (!w->hasAlpha()) {
- SetWindowDepth set_depth(w, 32);
- Q_UNUSED(set_depth)
- Effect::drawWindow(w, mask, region, data);
- } else
-#endif
- {
- Effect::drawWindow(w, mask, region, data);
- }
+ Effect::drawWindow(w, mask, region, data);
data.shader = old_shader;
@@ -357,4 +380,6 @@ void ScissorWindow::drawWindow(KWin::EffectWindow *w, int mask, QRegion region,
glActiveTexture(GL_TEXTURE1);
mask_texture->unbind();
glActiveTexture(GL_TEXTURE0);
+
+ glDisable(GL_BLEND);
}
diff --git a/plugins/kwineffects/scissor-window/scissorwindow.h b/plugins/kwineffects/scissor-window/scissorwindow.h
index 6e12a1adc..a778a1d97 100644
--- a/plugins/kwineffects/scissor-window/scissorwindow.h
+++ b/plugins/kwineffects/scissor-window/scissorwindow.h
@@ -23,6 +23,10 @@
#include <kwineffects.h>
+#ifndef DISBLE_DDE_KWIN_XCB
+#include "kwinutils.h"
+#endif
+
class ScissorWindow : public KWin::Effect
{
Q_OBJECT
diff --git a/plugins/platforms/lib/CMakeLists.txt b/plugins/platforms/lib/CMakeLists.txt
index 9dbf2474f..06379d0ab 100644
--- a/plugins/platforms/lib/CMakeLists.txt
+++ b/plugins/platforms/lib/CMakeLists.txt
@@ -3,6 +3,7 @@ set(TARGET_NAME "kwin-xcb")
find_package(Qt5Core REQUIRED)
find_package(Qt5X11Extras REQUIRED)
find_package(Qt5Qml REQUIRED)
+find_package(X11 REQUIRED)
find_package(KF5Config REQUIRED)
find_package(KF5WindowSystem REQUIRED)
find_package(KF5CoreAddons REQUIRED)
diff --git a/plugins/platforms/lib/kwinutils.cpp b/plugins/platforms/lib/kwinutils.cpp
index df1b8ce6b..ee283a60e 100644
--- a/plugins/platforms/lib/kwinutils.cpp
+++ b/plugins/platforms/lib/kwinutils.cpp
@@ -87,7 +87,11 @@ public:
public Q_SLOTS:
void slotWindowMove();
void slotWindowMaximize();
- bool compositing() const;
+#if !defined(KWIN_VERSION) || KWIN_VERSION < KWIN_VERSION_CHECK(5, 23, 4, 0)
+ // remove by c61085dc2e28cb7d737c9b049499b4433916b194
+ // change to Compositor::compositing()
+ bool compositing() const;
+ #endif
void slotTouchPadTomoveWindow(int x, int y);
void slotEndTouchPadToMoveWindow();
@@ -139,14 +143,23 @@ class Compositor : public QObject
public:
enum SuspendReason { NoReasonSuspend = 0, UserSuspend = 1<<0, BlockRuleSuspend = 1<<1, ScriptSuspend = 1<<2, AllReasonSuspend = 0xff };
static Compositor *s_compositor;
+ bool isActive();
};
// 光标管理
+#if defined(KWIN_VERSION) && KWIN_VERSION >= KWIN_VERSION_CHECK(5, 23, 4, 0)
+class Cursors : public QObject
+{
+public:
+ static Cursors *s_self;
+};
+#else
class Cursor : public QObject
{
public:
static Cursor *s_self;
};
+#endif
class AbstractClient : public QObject {};
class Options {
@@ -613,7 +626,11 @@ QObject *KWinUtils::tabBox()
QObject *KWinUtils::cursor()
{
+#if defined(KWIN_VERSION) && KWIN_VERSION >= KWIN_VERSION_CHECK(5, 23, 4, 0)
+ return KWin::Cursors::s_self;
+#else
return KWin::Cursor::s_self;
+#endif
}
QObject *KWinUtils::virtualDesktop()
@@ -643,8 +660,8 @@ QObjectList KWinUtils::clientList()
return {};
}
- QList<KWin::Client*> clients;
- bool ok = QMetaObject::invokeMethod(jsWorkspaceWrapper, "clientList", Q_RETURN_ARG(QList<KWin::Client*>, clients));
+ QList<KWin::AbstractClient*> clients;
+ bool ok = QMetaObject::invokeMethod(jsWorkspaceWrapper, "clientList", Q_RETURN_ARG(QList<KWin::AbstractClient*>, clients));
if (!ok) {
return {};
@@ -652,7 +669,7 @@ QObjectList KWinUtils::clientList()
QObjectList list;
- for (KWin::Client *c : clients) {
+ for (KWin::AbstractClient *c : clients) {
list << c;
}
@@ -1057,12 +1074,19 @@ void KWinUtils::removeWindowPropertyMonitor(quint32 property_atom)
bool KWinUtils::isCompositing()
{
+ #if defined(KWIN_VERSION) && KWIN_VERSION >= KWIN_VERSION_CHECK(5, 23, 4, 0)
+ if (KWin::Compositor::s_compositor) {
+ return KWin::Compositor::s_compositor->isActive();
+ }
+ #else
KWin::Workspace *ws = static_cast<KWin::Workspace *>(workspace());
if (ws) {
return ws->compositing();
} else {
return compositorIsActive();
}
+#endif
+ return compositorIsActive();
}
bool KWinUtils::buildNativeSettings(QObject *baseObject, quint32 windowID)
diff --git a/plugins/platforms/plugin/libkwinpreload.cpp b/plugins/platforms/plugin/libkwinpreload.cpp
index 55b509e4b..c8814bd8d 100644
--- a/plugins/platforms/plugin/libkwinpreload.cpp
+++ b/plugins/platforms/plugin/libkwinpreload.cpp
@@ -279,9 +279,11 @@ void RuleBook::save()
namespace BuiltInEffects {
bool supported(BuiltInEffect effect) {
+#ifdef ENABLE_BUILTIN_BLUR
if (effect == BuiltInEffect::Blur) {
return false;
}
+#endif
typedef bool (*ClientBuiltInEffect)(KWin::BuiltInEffect);
ClientBuiltInEffect clientBuildInEffect = (ClientBuiltInEffect)QLibrary::resolve("kwin", qApp->applicationVersion(), "_ZN4KWin14BuiltInEffects9supportedENS_13BuiltInEffectE");

View File

@ -1,38 +1,51 @@
%global repo dde-kwin
# not build kwin ext with kwin > 5.21.5
%global kwin_ext 0
%if !%{kwin_ext}
%global debug_package %{nil}
%define pkgrelease 1
%if 0%{?openeuler}
%define specrelease %{pkgrelease}
%else
## allow specrelease to have configurable %%{?dist} tag in other distribution
%define specrelease %{pkgrelease}%{?dist}
%endif
# not build kwin ext with kwin >= 5.25
%global kwin_ext 0
Name: dde-kwin
Version: 5.1.0.27
Release: 2
Version: 5.4.26
Release: %{specrelease}
Summary: KWin configuration for Deepin Desktop Environment
License: GPLv3+
URL: https://github.com/linuxdeepin/%{name}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
#Patch0: fix-compile-error.patch
Patch1: fix-kwin-5-21.patch
%if !%{kwin_ext}
%global debug_package %{nil}
%endif
# Fix crash with later kwin versions
Patch0001: https://raw.githubusercontent.com/archlinux/svntogit-community/6569e8f227a739b625164cbc549b1b54b2b7812c/trunk/dde-kwin.5.4.26.patch
# revert added functions from their forked kwin
# Author: Robin Lee <cheeselee@fedoraproject.org>
Patch0002: 0001-revert-added-functions-from-their-forked-kwin.patch
# https://github.com/linuxdeepin/dde-kwin/pull/106
Patch0003: https://raw.githubusercontent.com/archlinux/svntogit-community/73ec1ea59cd8ad607a3658fd1fbeed1725110821/trunk/deepin-kwin-tabbox-chameleon-rename.patch
BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: extra-cmake-modules >= 5.54
BuildRequires: gdb
BuildRequires: kwin-devel
BuildRequires: kwayland-server-devel
BuildRequires: pkgconfig(Qt5X11Extras)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: gsettings-qt-devel
BuildRequires: libepoxy-devel
BuildRequires: dtkgui-devel
BuildRequires: dtkcore-devel
BuildRequires: kf5-kwayland-devel
BuildRequires: kf5-kglobalaccel-devel
BuildRequires: kf5-kdeclarative-devel
BuildRequires: kf5-kservice-devel
BuildRequires: kf5-plasma-devel
BuildRequires: kdecoration-devel
BuildRequires: kf5-ktextwidgets-devel
BuildRequires: dtkgui-devel
BuildRequires: kf5-ki18n-devel
BuildRequires: cmake(KDecoration2)
BuildRequires: cmake(KF5I18n)
BuildRequires: qt5-linguist
%if %{kwin_ext}
# for libQt5EdidSupport.a
@ -53,13 +66,6 @@ Obsoletes: deepin-metacity-devel <= 3.22.24
Obsoletes: deepin-mutter <= 3.20.38
Obsoletes: deepin-mutter-devel <= 3.20.38
Requires: kf5-kconfig-core
Requires: kf5-kcoreaddons
Requires: kf5-kglobalaccel-libs
Requires: kf5-ki18n
Requires: kf5-kwindowsystem
Requires: kdecoration
%description
This package provides a kwin configuration that used as the new WM for Deepin
Desktop Environment.
@ -73,35 +79,39 @@ Requires: qt5-qtx11extras-devel%{?_isa}
Requires: gsettings-qt-devel%{?_isa}
Requires: dtkcore-devel%{?_isa}
Requires: kf5-kglobalaccel-devel%{?_isa}
Requires: deepin-desktop-server
%description devel
Header files and libraries for %{sname}.
%endif
%prep
%autosetup -n %{name}-%{version} -p1
sed -i 's:/lib:/%{_lib}:' plugins/kwin-xcb/lib/CMakeLists.txt
sed -i 's:/usr/lib:%{_libdir}:' plugins/kwin-xcb/plugin/main.cpp
%setup -q -n %{name}-%{version}
sed -i 's:/lib/:%{_libdir}/:' plugins/platforms/lib/CMakeLists.txt
sed -i 's:/lib/:/%{_lib}/:' plugins/platforms/plugin/main.cpp \
plugins/platforms/plugin/main_wayland.cpp
sed -i 's:/usr/lib:%{_libexecdir}:' deepin-wm-dbus/deepinwmfaker.cpp
sed -i 's/kwin 5.21.5/kwin 5.24.4/' configures/kwin_no_scale.in
%build
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease
export PATH=%{_qt5_bindir}:$PATH
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_BUILD_TYPE=Release -DKWIN_VERSION=$(rpm -q --qf '%%{version}' kwin-devel) .
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_WINDOW_TOOL=OFF \
-DENABLE_BUILTIN_BLUR=OFF \
-DENABLE_KDECORATION=ON \
-DENABLE_BUILTIN_MULTITASKING=OFF \
-DENABLE_BUILTIN_BLACK_SCREEN=OFF \
-DUSE_DEEPIN_WAYLAND=OFF \
%if !%{kwin_ext}
-DUSE_PLUGINS=OFF
%endif
%make_build
%install
%make_install INSTALL_ROOT=%{buildroot}
chmod 755 %{buildroot}%{_bindir}/kwin_no_scale
%if %{kwin_ext}
install debian/dde-kwin.postinst %{buildroot}%{_datadir}/kwin/scripts/
chmod 755 %{buildroot}%{_datadir}/kwin/scripts/dde-kwin.postinst
%post
bash -x %{_datadir}/kwin/scripts/dde-kwin.postinst
%endif
%ldconfig_scriptlets
%make_install
%files
%doc CHANGELOG.md
@ -110,19 +120,17 @@ bash -x %{_datadir}/kwin/scripts/dde-kwin.postinst
%{_bindir}/kwin_no_scale
%if %{kwin_ext}
%{_bindir}/deepin-wm-dbus
%{_libdir}/libkwin-xcb.so.*
%{_qt5_plugindir}/org.kde.kdecoration2/libdeepin-chameleon.so
%{_qt5_plugindir}/platforms/lib%{name}-xcb.so
%{_qt5_plugindir}/platforms/libdde-kwin-wayland.so
%{_datadir}/dde-kwin-xcb/
%{_datadir}/dbus-1/services/*.service
%{_datadir}/dbus-1/interfaces/*.xml
%{_datadir}/kwin/scripts/*
%{_datadir}/kwin/tabbox/*
%{_libdir}/qt5/plugins/kwin/effects/plugins/libblur.so
%{_libdir}/qt5/plugins/kwin/effects/plugins/libmultitasking.so
%{_libdir}/qt5/plugins/kwin/effects/plugins/libscissor-window.so
%{_qt5_plugindir}/org.kde.kdecoration2/libdeepin-chameleon.so
%{_qt5_plugindir}/platforms/lib%{repo}-xcb.so
%{_qt5_plugindir}/platforms/lib%{repo}-wayland.so
%{_qt5_plugindir}/kwin/effects/plugins/
%{_datadir}/dde-kwin-xcb/
%{_libdir}/libkwin-xcb.so.0
%{_libdir}/libkwin-xcb.so.0.*
%files devel
%{_libdir}/libkwin-xcb.so
@ -131,6 +139,9 @@ bash -x %{_datadir}/kwin/scripts/dde-kwin.postinst
%endif
%changelog
* Mon Jul 25 2022 konglidong <konglidong@uniontech.com> - 5.4.26-1
- update to 5.4.26
* Mon Feb 21 2022 liweigang <liweiganga@uniontech.com> - 5.1.0.27-2
- fix copmile error

View File

@ -0,0 +1,59 @@
commit 30f09148b0c1ab4843d6a146a26c99a8945a4346
Author: Felix Yan <felixonmars@archlinux.org>
Date: Wed Feb 26 18:36:20 2020 +0800
Rename thumbnail_grid to avoid conflict with new kdeplasma-addons
diff --git a/configures/kwinrc.in b/configures/kwinrc.in
index 9551f40ce..d5493c285 100644
--- a/configures/kwinrc.in
+++ b/configures/kwinrc.in
@@ -40,7 +40,7 @@ ActivitiesMode=1
ApplicationsMode=0
DesktopMode=1
HighlightWindows=true
-LayoutName=thumbnail_grid
+LayoutName=chameleon
MinimizedMode=0
MultiScreenMode=0
ShowDesktopMode=1
diff --git a/tabbox/CMakeLists.txt b/tabbox/CMakeLists.txt
index af1c0d929..d377f3056 100644
--- a/tabbox/CMakeLists.txt
+++ b/tabbox/CMakeLists.txt
@@ -1,6 +1,6 @@
install(
DIRECTORY
- thumbnail_grid
+ chameleon
DESTINATION
${CMAKE_INSTALL_PREFIX}/share/kwin/tabbox
)
diff --git a/tabbox/thumbnail_grid/contents/ui/main.qml b/tabbox/chameleon/contents/ui/main.qml
similarity index 100%
rename from tabbox/thumbnail_grid/contents/ui/main.qml
rename to tabbox/chameleon/contents/ui/main.qml
diff --git a/tabbox/thumbnail_grid/metadata.desktop b/tabbox/chameleon/metadata.desktop
similarity index 71%
rename from tabbox/thumbnail_grid/metadata.desktop
rename to tabbox/chameleon/metadata.desktop
index 7114afe0b..97ae44aa3 100755
--- a/tabbox/thumbnail_grid/metadata.desktop
+++ b/tabbox/chameleon/metadata.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Name=Thumbnail Grid
+Name=Chameleon
Comment=
Type=Service
@@ -11,7 +11,7 @@ X-Plasma-MainScript=ui/main.qml
Icon=preferences-system-windows-switcher-big-icons
X-KDE-PluginInfo-Author=Chris Holland
X-KDE-PluginInfo-Email=zrenfire@gmail.com
-X-KDE-PluginInfo-Name=thumbnail_grid
+X-KDE-PluginInfo-Name=chameleon
X-KDE-PluginInfo-Version=4
-X-KDE-PluginInfo-Website=https://github.com/Zren/kwin-tabbox-thumbnail_grid
+X-KDE-PluginInfo-Website=https://github.com/linuxdeepin/dde-kwin
X-KDE-PluginInfo-Depends=

View File

@ -1,34 +0,0 @@
diff -Naur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2022-02-22 15:25:22.415856536 +0800
+++ b/CMakeLists.txt 2022-02-22 15:26:40.216912594 +0800
@@ -73,7 +73,10 @@
endif()
add_subdirectory(configures)
-add_subdirectory(plugins)
-add_subdirectory(scripts)
-add_subdirectory(deepin-wm-dbus)
-add_subdirectory(tabbox)
+set(DDE_KWIN_SUPPORTED_VERSION "5.21.5")
+if (${KWIN_VERSION} STRLESS ${DDE_KWIN_SUPPORTED_VERSION} OR ${KWIN_VERSION} STREQUAL ${DDE_KWIN_SUPPORTED_VERSION})
+ add_subdirectory(plugins)
+ add_subdirectory(scripts)
+ add_subdirectory(deepin-wm-dbus)
+ add_subdirectory(tabbox)
+endif()
diff -Naur a/configures/kwin_no_scale.in b/configures/kwin_no_scale.in
--- a/configures/kwin_no_scale.in 2022-02-22 15:25:30.179862133 +0800
+++ b/configures/kwin_no_scale.in 2022-02-22 15:27:08.271932807 +0800
@@ -1,4 +1,12 @@
#!/bin/sh
+
+KWIN_VERSION=`kwin_x11 --version 2>/dev/null`
+DDE_KWIN_SUPPORTED_VERSION='kwin 5.21.5'
+if [ "$KWIN_VERSION" > "$DDE_KWIN_SUPPORTED_VERSION" ]; then
+ kwin_x11 $@
+ exit 0
+fi
+
if [ -n "$HOME" ];then
cp -n /etc/xdg/kglobalshortcutsrc $HOME/.config/kglobalshortcutsrc
fi