Skip to content

Conversation

@fly602
Copy link
Contributor

@fly602 fly602 commented Nov 3, 2025

Remove virtual device detection logic that was preventing bluetooth touchpad natural scrolling settings from being applied. The virtual device check was incorrectly filtering out legitimate bluetooth devices, causing PMS BUG-326583.

The changes include:

  1. Removed sysfsPath field from mouseInfo and touchpadInfo structs
  2. Modified getExtraInfo() to return only devNode and phys
  3. Removed isVirtual() methods for both mouse and touchpad
  4. Eliminated virtual device filtering in getMouseInfos() and getTPadInfos()

Log: Fixed bluetooth touchpad natural scrolling not working issue

Influence:

  1. Test bluetooth touchpad natural scrolling functionality
  2. Verify that all touchpad settings are properly applied
  3. Test with various bluetooth touchpad models
  4. Ensure no regression in physical device detection
  5. Verify that touchpad settings persist after reconnection

fix: 移除虚拟设备过滤以修复蓝牙触控板问题

移除了阻止蓝牙触控板自然滚动设置生效的虚拟设备检测逻辑。
虚拟设备检查错误地过滤了合法的蓝牙设备。

变更包括:

  1. 从 mouseInfo 和 touchpadInfo 结构中移除 sysfsPath 字段
  2. 修改 getExtraInfo() 仅返回 devNode 和 phys
  3. 移除鼠标和触控板的 isVirtual() 方法
  4. 在 getMouseInfos() 和 getTPadInfos() 中消除虚拟设备过滤

Log: 修复蓝牙触控板自然滚动无效的问题

Influence:

  1. 测试蓝牙触控板自然滚动功能
  2. 验证所有触控板设置都能正确应用
  3. 使用不同型号的蓝牙触控板进行测试
  4. 确保物理设备检测没有回归问题
  5. 验证触控板设置在重新连接后仍然有效
    PMS: BUG-326583

Summary by Sourcery

Remove virtual device filtering to ensure Bluetooth touchpad settings are applied correctly and simplify device info extraction.

Bug Fixes:

  • Allow Bluetooth touchpads to receive natural scrolling settings by removing erroneous virtual device filtering.

Enhancements:

  • Simplify mouseInfo and touchpadInfo structs by dropping sysfsPath and isVirtual methods.
  • Update getExtraInfo to return only device node and phys and eliminate virtual filtering in device enumeration.

Remove virtual device detection logic that was preventing bluetooth
touchpad natural scrolling settings from being applied. The virtual
device check was incorrectly filtering out legitimate bluetooth
devices, causing PMS BUG-326583.

The changes include:
1. Removed sysfsPath field from mouseInfo and touchpadInfo structs
2. Modified getExtraInfo() to return only devNode and phys
3. Removed isVirtual() methods for both mouse and touchpad
4. Eliminated virtual device filtering in getMouseInfos() and
getTPadInfos()

Log: Fixed bluetooth touchpad natural scrolling not working issue

Influence:
1. Test bluetooth touchpad natural scrolling functionality
2. Verify that all touchpad settings are properly applied
3. Test with various bluetooth touchpad models
4. Ensure no regression in physical device detection
5. Verify that touchpad settings persist after reconnection

fix: 移除虚拟设备过滤以修复蓝牙触控板问题

移除了阻止蓝牙触控板自然滚动设置生效的虚拟设备检测逻辑。
虚拟设备检查错误地过滤了合法的蓝牙设备。

变更包括:
1. 从 mouseInfo 和 touchpadInfo 结构中移除 sysfsPath 字段
2. 修改 getExtraInfo() 仅返回 devNode 和 phys
3. 移除鼠标和触控板的 isVirtual() 方法
4. 在 getMouseInfos() 和 getTPadInfos() 中消除虚拟设备过滤

Log: 修复蓝牙触控板自然滚动无效的问题

Influence:
1. 测试蓝牙触控板自然滚动功能
2. 验证所有触控板设置都能正确应用
3. 使用不同型号的蓝牙触控板进行测试
4. 确保物理设备检测没有回归问题
5. 验证触控板设置在重新连接后仍然有效
PMS: BUG-326583
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 3, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR removes legacy sysfsPath support and virtual-device filtering in inputdevice enumeration: the sysfsPath field and related methods are dropped from device info structs, getExtraInfo is simplified to only return devNode and phys, and all isVirtual checks and filters are removed to ensure Bluetooth touchpads are correctly recognized.

Class diagram for updated mouseInfo and touchpadInfo structs

classDiagram
class mouseInfo {
  *dxinput.Mouse
  devNode string
  phys string
}
class touchpadInfo {
  *dxinput.Touchpad
  devNode string
  phys string
}
Loading

Class diagram for removed isVirtual methods

classDiagram
class mouseInfo {
  ~isVirtual() bool // Removed
}
class touchpadInfo {
  ~isVirtual() bool // Removed
}
Loading

Flow diagram for device info filtering logic after PR

flowchart TD
    A["getMouseInfos()"] --> B["Create mouseInfo from device"]
    B --> C["Add to mouse list (no virtual device filtering)"]
    A2["getTPadInfos()"] --> B2["Create touchpadInfo from device"]
    B2 --> C2["Add to touchpad list (no virtual device filtering)"]
Loading

File-Level Changes

Change Details Files
Remove sysfsPath fields from device info structs
  • Deleted sysfsPath from mouseInfo
  • Deleted sysfsPath from touchpadInfo
inputdevices1/wrapper.go
Simplify getExtraInfo to only return devNode and phys
  • Changed getExtraInfo signature to drop sysfsPath return
  • Removed sysfsPath assignment in getExtraInfo
  • Updated calls to getExtraInfo to handle two return values
inputdevices1/wrapper.go
Eliminate virtual device filtering logic
  • Removed isVirtual methods from mouseInfo and touchpadInfo
  • Deleted conditional checks for virtual devices in getMouseInfos
  • Deleted conditional checks for virtual devices in getTPadInfos
inputdevices1/wrapper.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Double-check that devices with empty phys values aren’t now merged together incorrectly since sysfsPath filtering was removed.
  • Ensure no other code paths or logs still expect the deprecated sysfsPath field or isVirtual methods.
  • Consider extracting the shared device-info construction logic in getMouseInfos and getTPadInfos now that the virtual-device checks are gone to reduce duplication.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Double-check that devices with empty phys values aren’t now merged together incorrectly since sysfsPath filtering was removed.
- Ensure no other code paths or logs still expect the deprecated sysfsPath field or isVirtual methods.
- Consider extracting the shared device-info construction logic in getMouseInfos and getTPadInfos now that the virtual-device checks are gone to reduce duplication.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个diff进行审查:

  1. 代码质量改进:
  • 删除了sysfsPath字段及相关代码:这是一个好的改动,因为代码中实际并未使用这个字段,删除它可以减少内存占用和简化代码结构。
  • 简化了getExtraInfo函数的返回值:移除了未使用的sysfsPath返回值,使函数接口更清晰。
  • 移除了isVirtual方法及相关检查:这个改动需要谨慎。删除虚拟设备检查可能会导致系统处理不必要的虚拟设备,建议评估是否真的需要这个功能。
  1. 性能改进:
  • 减少了不必要的字符串操作:移除了isVirtual方法中的strings.Contains检查。
  • 减少了内存分配:移除了sysfsPath字段的存储。
  • 简化了代码执行路径:移除了一些条件判断。
  1. 安全性考虑:
  • 移除虚拟设备检查可能会带来潜在风险,建议确认是否真的不需要区分虚拟设备。
  • getExtraInfo函数中仍然保留了udevDev.Unref(),这是好的实践,确保资源正确释放。
  1. 代码规范建议:
  • 函数getTouchpadInfoByDxTouchpad和getMouseInfoByDxMouse的实现可以进一步简化,直接返回结构体字面量。
  • 建议添加更多注释说明移除虚拟设备检查的原因。
  • 建议在移除isVirtual方法后,确保其他地方没有依赖这个方法的功能。
  1. 潜在问题:
  • 移除虚拟设备检查可能会导致系统行为发生变化,建议进行充分测试。
  • 代码中仍然存在一些重复的逻辑,比如getMouseInfoByDxMouse和getTouchpadInfoByDxTouchpad函数的结构类似,可以考虑进一步重构。

总体来说,这个diff主要简化了代码结构,移除了未使用的功能,但需要注意移除虚拟设备检查可能带来的影响。建议在合并前进行充分测试,确保系统行为符合预期。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, mhduiy

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fly602 fly602 merged commit f53c48c into linuxdeepin:master Nov 6, 2025
14 of 17 checks passed
@fly602 fly602 deleted the fix-touchpad branch November 7, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants