1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
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:
void slotWindowMove();
void slotWindowMaximize();
bool compositing() const;
+ 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>
|