Skip to content

Commit

Permalink
fix: 解决禁用触控板无法禁用的问题
Browse files Browse the repository at this point in the history
解决禁用触控板无法禁用的问题

Log: 解决禁用触控板无法禁用的问题
pms: BUG-295823
  • Loading branch information
fly602 committed Dec 18, 2024
1 parent c94147b commit 91703b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inputdevices1/mouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (m *Mouse) init() {
tpad := m.touchPad

if !m.Exist {
if tpad.Exist && !tpad.TPadEnable.Get() {
if tpad.Exist && tpad.TPadEnable.Get() {
tpad.enable(true)
}
return
Expand Down
9 changes: 9 additions & 0 deletions inputdevices1/touchpad.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ func (tpad *Touchpad) updateDXTpads() {
}

func (tpad *Touchpad) enable(enabled bool) {
if enabled == tpad.TPadEnable.Get() {
return
}
if len(tpad.devInfos) > 0 {
for _, v := range tpad.devInfos {
err := v.Enable(enabled)
Expand All @@ -256,6 +259,12 @@ func (tpad *Touchpad) enable(enabled bool) {

enableGesture(enabled)
tpad.TPadEnable.Set(enabled)
sysTouchPad, err := inputdevices.NewTouchpad(tpad.systemConn, "/org/deepin/dde/InputDevices1/Touchpad")
if err == nil && sysTouchPad != nil {
if err = sysTouchPad.SetTouchpadEnable(0, enabled); err != nil {
logger.Warning(err)
}
}
}

func (tpad *Touchpad) enableLeftHanded() {
Expand Down

0 comments on commit 91703b2

Please sign in to comment.