Visitar URL original
inputdevices 触摸板设置在 dconfig 暂时不可读时被整体应用为 false/零值(轻点/双指滚动失效) · Issue #1270 · linuxdeepin/dde-daemon · GitHub
Skip to content

inputdevices 触摸板设置在 dconfig 暂时不可读时被整体应用为 false/零值(轻点/双指滚动失效) #1270

Open

Description

@hualet

环境

  • Deepin 25 / dde-daemon 6.1.101(6.1.107 源码核对)/ X11
  • AMD 平台笔记本,触摸板 ELAN0662(04F3:317C,i2c-hid,ClickPad),libinput 驱动

现象

开机后会话运行期间,触摸板 libinput 属性被整体打回坏值:

libinput Tapping Enabled: 0
libinput Natural Scrolling Enabled: 0
libinput Disable While Typing Enabled: 0
libinput Scroll Method Enabled: 0, 0, 0   (三种滚动模式全部未启用)

导致轻点点击与双指滚动失效。而此时 dconfig(org.deepin.dde.daemon.touchpad)中 tapToClick/naturalScroll/vertScrollEnabled/horizScrollEnabled 的实际值全部为 true。X 设备并未重建(Xorg 日志无重枚举记录),属性是被原地改写的。

根因链(源码核对)

  1. common/dconfig/dcprop.go Bool.Get():GetValueBool 出错时静默返回 false(数值类型同模式返回零值),"读失败"与"配置就是 false"不可区分;
  2. common/dconfig/dconfig.go GetValue:每次都是实时 DBus 往返(system bus → org.desktopspec.ConfigManager),无缓存;dde-dconfig-daemon 是开机才由总线激活的服务,会话启动竞态、服务重启、总线拥塞都构成读失败窗口;
  3. inputdevices1/touchpad.go:init() 按 natural → edge → tap → twoFinger 顺序整体应用,enableTapToClick/enableNaturalScroll/enableEdgeScroll/enableTwoFingerScroll/disableWhileTyping 均以 Get() 结果无条件写 X 属性;触发点包括 X 设备变化(wrapper.go handleDeviceChanged)与 dconfig ValueChanged;
  4. dxinput 的 libinput 滚动写器互斥清位,false/零值组合下合成 Scroll Method Enabled = 0,0,0;
  5. apply 失败仅 logger.Debugf,生产日志级别不可见——这也是该问题难以定位的原因。

一次读失败窗口内的整体重应用,结果恰好就是上面观测到的坏值组合。

修复建议

  • common/dconfig:Bool 增加最近成功值缓存;新增 GetWithError() (bool, error) 暴露读取错误;
  • inputdevices1/touchpad.go:各 apply 函数读失败时跳过本次应用(属性保持现状)并记 Warning 日志。

修复 PR 见后续链接。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions