From 5050b6150c73c8f5550945a27053cdc06c524fad Mon Sep 17 00:00:00 2001 From: runtime Date: Thu, 17 Sep 2026 02:02:18 +0800 Subject: [PATCH] fix: align wakeupPath PS/2 check with isWakeupMachine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: DeviceInput::wakeupPath() only checked m_Name.contains("PS/2") to select the PS/2 wakeup path, while isWakeupMachine() already used m_Name || m_Interface check 2. PS/2 keyboards named "AT Translated Set 2 keyboard" do not contain "PS/2" in name, so wakeupPath() returned wrong sysfs path instead of /proc/acpi/wakeup, causing canWakeupMachine() to return false 3. Fix: add m_Interface.contains("PS/2") to the condition in wakeupPath(), aligning with isWakeupMachine() at line 488 Log: Fix PS/2 keyboard "allow wake computer" menu item greyed out Influence: 1. Test PS/2 keyboard right-click menu shows "allow wake computer" 2. Test PS/2 mouse wakeup function remains normal 3. Test USB and Bluetooth keyboard/mouse wakeup unaffected fix: 对齐wakeupPath与isWakeupMachine的PS/2判断条件 1. 根因:DeviceInput::wakeupPath()仅检查m_Name.contains("PS/2") 来选择PS/2唤醒路径,而isWakeupMachine()已使用m_Name|| m_Interface双条件判断 2. PS/2键盘名称通常为"AT Translated Set 2 keyboard",不含"PS/2", 导致wakeupPath()返回错误的sysfs路径而非/proc/acpi/wakeup, canWakeupMachine()返回false,菜单项被置灰 3. 方案:在wakeupPath()条件中增加m_Interface.contains("PS/2"), 与第488行isWakeupMachine()保持一致 Log: 修复PS/2键盘"允许唤起电脑"菜单项置灰问题 Influence: 1. 测试PS/2键盘右键菜单"允许唤起电脑"选项可正常使用 2. 测试PS/2鼠标唤起功能不受影响 3. 测试USB和蓝牙键盘/鼠标唤起功能不受影响 PMS: BUG-294489 --- deepin-devicemanager/src/DeviceManager/DeviceInput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp b/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp index 11f3e221f..bc8518ba1 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp @@ -505,7 +505,7 @@ QString DeviceInput::wakeupPath() return ""; } - if (m_Name.contains("PS/2")) { + if (m_Name.contains("PS/2") || m_Interface.contains("PS/2")) { return "/proc/acpi/wakeup"; } else { return QString("/sys") + m_SysPath.left(index) + QString("/power/wakeup");