141 lines
5.9 KiB
Diff
141 lines
5.9 KiB
Diff
From dec1b2e8501c3f20c83efa6c8d9f5124fccaf316 Mon Sep 17 00:00:00 2001
|
|
From: meizhigang <meizhigang@kylinsec.com.cn>
|
|
Date: Tue, 16 Apr 2024 14:52:46 +0800
|
|
Subject: [PATCH] fix(touchpad):Fix touchpad display with the type psmouse
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
-适配psmouse类型触摸板设备
|
|
|
|
Related #34878
|
|
---
|
|
....kylinsec.Kiran.SessionDaemon.TouchPad.xml | 15 ++++
|
|
plugins/mouse/pages/touchpad-page.cpp | 72 +++++++++++--------
|
|
2 files changed, 58 insertions(+), 29 deletions(-)
|
|
|
|
diff --git a/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml b/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml
|
|
index 8087b87..f5527ad 100644
|
|
--- a/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml
|
|
+++ b/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml
|
|
@@ -36,6 +36,21 @@
|
|
Click methods are usually only available on clickpads.</description>
|
|
</property>
|
|
|
|
+ <property name="disable_while_typing_support" type="b" access="readwrite">
|
|
+ <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
|
+ <description>The support of disable while typing.</description>>
|
|
+ </property>
|
|
+
|
|
+ <property name="tap_to_click_support" type="b" access="readwrite">
|
|
+ <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
|
+ <description>The support of tap to click.</description>
|
|
+ </property>
|
|
+
|
|
+ <property name="click_method_support" type="b" access="readwrite">
|
|
+ <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
|
+ <description>The support of click method.</description>
|
|
+ </property>
|
|
+
|
|
<property name="scroll_method" type="i" access="readwrite">
|
|
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
|
<description>Enables a scroll method. Permitted methods are twofinger, edge and button.</description>
|
|
diff --git a/plugins/mouse/pages/touchpad-page.cpp b/plugins/mouse/pages/touchpad-page.cpp
|
|
index 21062be..63bacc1 100644
|
|
--- a/plugins/mouse/pages/touchpad-page.cpp
|
|
+++ b/plugins/mouse/pages/touchpad-page.cpp
|
|
@@ -13,11 +13,11 @@
|
|
*/
|
|
|
|
#include "touchpad-page.h"
|
|
-#include "kcm-manager.h"
|
|
#include <kiran-log/qt5-log-i.h>
|
|
#include <kiran-session-daemon/touchpad-i.h>
|
|
#include <QCheckBox>
|
|
#include <QDBusConnection>
|
|
+#include "kcm-manager.h"
|
|
#include "touchPad_backEnd_proxy.h"
|
|
#include "ui_touchpad-page.h"
|
|
|
|
@@ -204,35 +204,49 @@ void TouchPadPage::initComponent()
|
|
},
|
|
Qt::QueuedConnection);
|
|
|
|
- //打字时触摸板禁用
|
|
- m_disabelWhileTyping = m_touchPadInterface->disable_while_typing();
|
|
- ui->checkBox_disable_while_typing->setChecked(m_disabelWhileTyping);
|
|
- connect(ui->checkBox_disable_while_typing, &KiranSwitchButton::toggled,
|
|
- [this](bool disabelWhileTyping) {
|
|
- m_disabelWhileTyping = disabelWhileTyping;
|
|
- m_touchPadInterface->setDisable_while_typing(m_disabelWhileTyping);
|
|
- });
|
|
- connect(
|
|
- m_touchPadInterface.data(), &TouchPadBackEndProxy::disable_while_typingChanged, this,
|
|
- [this](bool value) {
|
|
- setValue(ui->checkBox_disable_while_typing, m_disabelWhileTyping, value);
|
|
- },
|
|
- Qt::QueuedConnection);
|
|
+ if (m_touchPadInterface->disable_while_typing_support())
|
|
+ {
|
|
+ //打字时触摸板禁用
|
|
+ m_disabelWhileTyping = m_touchPadInterface->disable_while_typing();
|
|
+ ui->checkBox_disable_while_typing->setChecked(m_disabelWhileTyping);
|
|
+ connect(ui->checkBox_disable_while_typing, &KiranSwitchButton::toggled,
|
|
+ [this](bool disabelWhileTyping) {
|
|
+ m_disabelWhileTyping = disabelWhileTyping;
|
|
+ m_touchPadInterface->setDisable_while_typing(m_disabelWhileTyping);
|
|
+ });
|
|
+ connect(
|
|
+ m_touchPadInterface.data(), &TouchPadBackEndProxy::disable_while_typingChanged, this,
|
|
+ [this](bool value) {
|
|
+ setValue(ui->checkBox_disable_while_typing, m_disabelWhileTyping, value);
|
|
+ },
|
|
+ Qt::QueuedConnection);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ ui->widget_disable_while_typing->hide();
|
|
+ }
|
|
|
|
- //轻击(不按下)触摸板功能是否生效
|
|
- m_tapToClick = m_touchPadInterface->tap_to_click();
|
|
- ui->checkBox_tap_to_click->setChecked(m_tapToClick);
|
|
- connect(ui->checkBox_tap_to_click, &KiranSwitchButton::toggled,
|
|
- [this](bool isTapToClick) {
|
|
- m_tapToClick = isTapToClick;
|
|
- m_touchPadInterface->setTap_to_click(m_tapToClick);
|
|
- });
|
|
- connect(
|
|
- m_touchPadInterface.data(), &TouchPadBackEndProxy::tap_to_clickChanged, this,
|
|
- [this](bool value) {
|
|
- setValue(ui->checkBox_tap_to_click, m_tapToClick, value);
|
|
- },
|
|
- Qt::QueuedConnection);
|
|
+ if (m_touchPadInterface->tap_to_click_support())
|
|
+ {
|
|
+ //轻击(不按下)触摸板功能是否生效
|
|
+ m_tapToClick = m_touchPadInterface->tap_to_click();
|
|
+ ui->checkBox_tap_to_click->setChecked(m_tapToClick);
|
|
+ connect(ui->checkBox_tap_to_click, &KiranSwitchButton::toggled,
|
|
+ [this](bool isTapToClick) {
|
|
+ m_tapToClick = isTapToClick;
|
|
+ m_touchPadInterface->setTap_to_click(m_tapToClick);
|
|
+ });
|
|
+ connect(
|
|
+ m_touchPadInterface.data(), &TouchPadBackEndProxy::tap_to_clickChanged, this,
|
|
+ [this](bool value) {
|
|
+ setValue(ui->checkBox_tap_to_click, m_tapToClick, value);
|
|
+ },
|
|
+ Qt::QueuedConnection);
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ ui->widget_tap_to_click->hide();
|
|
+ }
|
|
}
|
|
|
|
void TouchPadPage::setValue(KiranSwitchButton *receiveWidget, bool &origVal, bool newVal)
|
|
--
|
|
2.27.0
|
|
|