From e6632a7665610afb3b8002c3aa93432f462aae5e Mon Sep 17 00:00:00 2001 From: majiuping Date: Mon, 10 Aug 2026 16:12:12 +0800 Subject: [PATCH] fix: fix missing wake option for PS/2 keyboard in device manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复 wakeupPath() 中 PS/2 设备判断条件不一致问题; 2. 增加对 m_Interface 字段的 PS/2 判断, 使其与 isWakeupMachine() 逻辑一致; 3. PS/2 键盘设备名称不含 "PS/2" 字符串时也能正确返回 /proc/acpi/wakeup 路径; 4. 更新 SPDX 版权年份为 2022-2026; ===================================== 1. fixed inconsistent PS/2 device detection in wakeupPath(); 2. added m_Interface check to align with isWakeupMachine() logic; 3. PS/2 keyboard devices without "PS/2" in name now correctly return /proc/acpi/wakeup path; 4. updated SPDX copyright year to 2022-2026; Log: 修复设备管理器中 PS/2 键盘右键菜单缺少 "允许唤起电脑" 选项的问题, 原因是 wakeupPath() 判断条件与 isWakeupMachine() 不一致 Bug: https://pms.uniontech.com/bug-view-294489.html --- deepin-devicemanager/src/DeviceManager/DeviceInput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp b/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp index 11f3e221..8ee0ed84 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceInput.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -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");