Skip to content

Commit bc7a51c

Browse files
Tanghongyaodeepin-bot[bot]
authored andcommitted
fix: 鼠标在不能用的情况下,解决能用鼠标唤醒的问题
鼠标在不能用的情况下,解决能用鼠标唤醒的问题 Log: 记录状态,禁用之前,将唤醒能力关掉;启动时,再将唤醒能力打开。 Bug: https://pms.uniontech.com/bug-view-254187.html
1 parent 417b23f commit bc7a51c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

deepin-devicemanager/src/DeviceManager/DeviceInput.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ const QString DeviceInput::getOverviewInfo()
349349
*
350350
* 修改:修改触摸板禁用方法,改为调用daemon提供的接口
351351
*/
352+
352353
EnableDeviceStatus DeviceInput::setEnable(bool e)
353354
{
354355
if (m_Name.contains("Touchpad", Qt::CaseInsensitive)) {
@@ -363,6 +364,15 @@ EnableDeviceStatus DeviceInput::setEnable(bool e)
363364
if (m_UniqueID.isEmpty() || m_SysPath.isEmpty()) {
364365
return EDS_Faild;
365366
}
367+
if(e){
368+
if(isWakeupMachine()){
369+
DBusWakeupInterface::getInstance()->setWakeupMachine(wakeupID(), sysPath(), false, name());
370+
m_wakeupChanged = true;
371+
}
372+
} else if (m_wakeupChanged) {
373+
m_wakeupChanged = false;
374+
DBusWakeupInterface::getInstance()->setWakeupMachine(wakeupID(), sysPath(), true, name());
375+
}
366376
bool res = DBusEnableInterface::getInstance()->enable(m_HardwareClass, m_Name, m_SysPath, m_UniqueID, e, m_Driver);
367377
if (res) {
368378
m_Enable = e;

deepin-devicemanager/src/DeviceManager/DeviceInput.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ class DeviceInput : public DeviceBaseInfo
184184
QString m_KeyToLshw; //<!
185185
QString m_WakeupID; //<! wakeup id
186186
bool m_BluetoothIsConnected; //<! 记录蓝牙的连接状态
187+
bool m_wakeupChanged = true; //<! 记录鼠标的唤醒状态
187188

188189
QString m_keysToPairedDevice; //<! 【用来标识蓝牙键盘】
190+
189191
};
190192

191193
#endif // DEVICEINPUT_H

0 commit comments

Comments
 (0)