-
Notifications
You must be signed in to change notification settings - Fork 12
fix:greeter界面触控板无法点击异常 #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:greeter界面触控板无法点击异常 #28
Conversation
有些厂商系统,未默认设置触控点击属性,致使greeter界面点击无效 Log: 修复greeter触控点击异常异常问题 Bug: https://pms.uniontech.com/task-view-368567.html Influence: 触控屏 Change-Id: I3ed0d90831ac8f849937982ba47e46bad8258e6f (cherry picked from commit ebb83b33e62ac41d4428977d1055755bd2d46696)
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#28
deepin pr auto review代码审查意见如下:
综合以上意见,改进后的代码可能如下: #在满足条件下,设置tapToClick=true
#解析dbus信息输出
dbus_values_get_strings(){
local input="$1"
echo "$input" | grep -oP 'string \K".*?"' | tr -d '"'
}
dbus_values_get_bool(){
local input="$1"
echo "$input" | grep -oP 'boolean \K(true|false)'
}
#判断并设置设备属性
device_handle(){
local input="$1"
local dbus_touchpad_value=$(dbus-send --session --print-reply --dest=org.kde.KWin $input org.freedesktop.DBus.Properties.Get string:"org.kde.KWin.InputDevice" string:"touchpad" 2>/dev/null)
if [ $? -ne 0 ]; then
echo "Failed to get touchpad property for $input"
return 1
fi
local touchpad=$(dbus_values_get_bool "$dbus_touchpad_value")
if [ "$touchpad" = "true" ]; then
dbus-send --session --dest=org.kde.KWin "$input" org.freedesktop.DBus.Properties.Set string:"org.kde.KWin.InputDevice" string:"tapToClick" variant:boolean:true 2>/dev/null
if [ $? -ne 0 ]; then
echo "Failed to set tapToClick property for $input"
return 1
fi
fi
}
#获取设备列表
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" 2>/dev/null)
if [ $? -ne 0 ]; then
echo "Failed to get devices list"
exit 1
fi
devices_strings=$(dbus_values_get_strings "$dbus_devices")
#遍历设备列表
device_path="/org/kde/KWin/InputDevice/"
for dev in $devices_strings; do
path="${device_path}${dev}"
device_handle "$path"
done以上改进包括错误处理、性能优化、安全性增强和代码可读性的提升。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: waterlovemelon, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
有些厂商系统,未默认设置触控点击属性,致使greeter界面点击无效
Log: 修复greeter触控点击异常异常问题
Bug: https://pms.uniontech.com/task-view-368567.html Influence: 触控屏
Change-Id: I3ed0d90831ac8f849937982ba47e46bad8258e6f (cherry picked from commit ebb83b33e62ac41d4428977d1055755bd2d46696)