Skip to content

Commit 83b5265

Browse files
committed
feat(inputdevices): disable touchpad gestures when mouse is plugged in
Sync touchpad gesture state with touchpad hardware state in setDisableTemporary, so gestures are disabled together with the touchpad when a mouse is inserted and re-enabled when the mouse is removed. 插入鼠标禁用触控板时,同步禁用触控板手势;拔出鼠标时恢复手势。 Log: 插入鼠标禁用触控板时同步禁用手势 PMS: 360815 Influence: 开启"插入鼠标时禁用触控板"后,插入鼠标会同时禁用触控板手势,拔出后自动恢复。
1 parent c355768 commit 83b5265

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

inputdevices1/touchpad.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (tpad *Touchpad) updateDXTpads() {
279279
tpad.PropsMu.Unlock()
280280
}
281281

282-
// 受鼠标禁用触控板影响,临时关闭触控板
282+
// 受鼠标禁用触控板影响,临时关闭触控板及手势
283283
func (tpad *Touchpad) setDisableTemporary(disable bool) {
284284
if len(tpad.devInfos) > 0 {
285285
for _, v := range tpad.devInfos {
@@ -290,6 +290,7 @@ func (tpad *Touchpad) setDisableTemporary(disable bool) {
290290
}
291291
}
292292
}
293+
enableGesture(!disable && tpad.TPadEnable)
293294
}
294295

295296
func (tpad *Touchpad) enable(enabled bool) {

0 commit comments

Comments
 (0)