Skip to content

Commit bc7259f

Browse files
谢朋豪deepin-bot[bot]
authored andcommitted
fix:greeter界面触控板无法点击异常
有些厂商系统,未默认设置触控点击属性,致使greeter界面点击无效 Log: 修复greeter触控点击异常异常问题 Bug: https://pms.uniontech.com/task-view-368567.html Influence: 触控屏 Change-Id: I3ed0d90831ac8f849937982ba47e46bad8258e6f (cherry picked from commit ebb83b33e62ac41d4428977d1055755bd2d46696)
1 parent 2acbb4c commit bc7259f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

files/wayland/lightdm-deepin-greeter-wayland

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,37 @@ if [ -x $display_daemon ]; then
1515
fi
1616

1717

18+
#在满足条件下,设置tapToClick=true
19+
#解析dbus信息输出
20+
dbus_values_get_strings(){
21+
local input="$1"
22+
echo "$input" | grep -oP 'string \K".*?"' | tr -d '"'
23+
}
24+
dbus_values_get_bool(){
25+
local input="$1"
26+
echo "$input" | grep -oP 'boolean \Ktrue|false' | awk '{print $1}'
27+
}
28+
29+
#判断并设置设备属性
30+
device_handle(){
31+
local input="$1"
32+
local dbus_touchpad=$(dbus-send --session --print-reply --dest=org.kde.KWin $input org.freedesktop.DBus.Properties.Get string:"org.kde.KWin.InputDevice" string:"touchpad")
33+
local touchpad=$(dbus_values_get_bool "$dbus_touchpad")
34+
35+
if [ "$touchpad" = "true" ]; then
36+
dbus-send --session --dest=org.kde.KWin "$input" org.freedesktop.DBus.Properties.Set string:"org.kde.KWin.InputDevice" string:"tapToClick" variant:boolean:true
37+
fi
38+
}
39+
40+
#获取设备列表
41+
dbus_devices=$(dbus-send --session --print-reply --dest=org.kde.KWin /org/kde/KWin/InputDevice org.freedesktop.DBus.Properties.Get string:"org.kde.KWin.InputDeviceManager" string:"devicesSysNames")
42+
devices_strings=$(dbus_values_get_strings "$dbus_devices")
43+
44+
#遍历设备列表
45+
device_path="/org/kde/KWin/InputDevice/"
46+
for dev in $devices_strings; do
47+
path="${device_path}${dev}"
48+
device_handle "$path"
49+
done
50+
1851
/usr/share/dde-session-shell/greeters.d/launch-binary

0 commit comments

Comments
 (0)