Группа :: Графические оболочки/Прочее
Пакет: deepin-kwin
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: deepin-kwin-added-functions-from-their-forked-kwin.patch
Скачать
Скачать
From 23a92e4839509ee3ef8886618ce1ee4cfbec3427 Mon Sep 17 00:00:00 2001
From: wangxinbo <wangxinbo@uniontech.com>
Date: Tue, 11 Aug 2020 14:19:26 +0800
Subject: [PATCH] feat: add touch pad double click with three fingers to move
active client
pms task id 30501
---
deepin-wm-dbus/com.deepin.wm.xml.in | 6 ++++++
deepin-wm-dbus/deepinwmfaker.cpp | 10 ++++++++++
deepin-wm-dbus/deepinwmfaker.h | 3 +++
plugins/platforms/lib/kwinutils.cpp | 18 ++++++++++++++++++
plugins/platforms/lib/kwinutils.h | 2 ++
.../plugin/org.kde.kwin.KWinUtils.xml | 6 ++++++
6 files changed, 45 insertions(+)
diff --git a/deepin-wm-dbus/com.deepin.wm.xml.in b/deepin-wm-dbus/com.deepin.wm.xml.in
index 8a45365..ff4629a 100644
--- a/deepin-wm-dbus/com.deepin.wm.xml.in
+++ b/deepin-wm-dbus/com.deepin.wm.xml.in
@@ -184,4 +184,10 @@
<method name="GetCurrentDesktopStatus">
<arg type="b" name="isDesktop" direction="out"/>
</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 453280d..2f3f48a 100644
--- a/deepin-wm-dbus/deepinwmfaker.cpp
+++ b/deepin-wm-dbus/deepinwmfaker.cpp
@@ -681,6 +681,20 @@ 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 9ee73ab..ae6374a 100644
--- a/deepin-wm-dbus/deepinwmfaker.h
+++ b/deepin-wm-dbus/deepinwmfaker.h
@@ -136,6 +136,8 @@ 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 8bf9e27..0be9682 100644
--- a/plugins/platforms/lib/kwinutils.cpp
+++ b/plugins/platforms/lib/kwinutils.cpp
@@ -88,6 +88,8 @@ 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
@@ -1082,6 +1084,22 @@ 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 57edb86..2c75875 100644
--- a/plugins/platforms/lib/kwinutils.h
+++ b/plugins/platforms/lib/kwinutils.h
@@ -156,6 +156,8 @@ 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 aa61b6c..5854ed0 100644
--- a/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml
+++ b/plugins/platforms/plugin/org.kde.kwin.KWinUtils.xml
@@ -22,4 +22,10 @@
<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>