Skip to content

Conversation

@GongHeng2017
Copy link
Contributor

@GongHeng2017 GongHeng2017 commented Oct 17, 2025

-- Logic code error. Not find the id of mouse or keyboard to set awake.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-336943.html

Summary by Sourcery

Fix wakeup enable/disable logic by adding hardware class and interface context to DBusWakeupInterface and updating all callers to pass these parameters for correct PS/2 mouse vs keyboard handling

Bug Fixes:

  • Fix failure to identify mouse or keyboard when setting wakeup state

Enhancements:

  • Extend DBusWakeupInterface methods to accept hardware class and interface type parameters
  • Differentiate PS/2 mouse and keyboard wakeup devices by using hardware class to choose PS2M or PS2K keys
  • Propagate new hardware class and interface arguments through DeviceInput, UI widgets, and page components

-- Logic code error. Not find the id of mouse or keyboard to set awake.

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-336943.html
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017

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

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 17, 2025

Reviewer's Guide

This PR enhances the DBus wakeup interface to correctly identify PS/2 mice versus keyboards by introducing a hardware class parameter, refines the wakeup key logic accordingly, and propagates these changes through all relevant call sites while cleaning up obsolete checks.

Sequence diagram for setting wakeup state with hardware class

sequenceDiagram
    participant DeviceInput
    participant DBusWakeupInterface
    DeviceInput->>DBusWakeupInterface: setWakeupMachine(wakeupID, sysPath, wakeup, name, m_HardwareClass)
    DBusWakeupInterface->>DBusWakeupInterface: Determine key ("PS2M" for mouse, "PS2K" for keyboard)
    DBusWakeupInterface->>DBusWakeupInterface: Call SetWakeupDevices with correct path and state
Loading

Sequence diagram for checking input wakeup state with hardware class and interface type

sequenceDiagram
    participant DeviceInput
    participant DBusWakeupInterface
    DeviceInput->>DBusWakeupInterface: isInputWakeupMachine(m_SysPath, m_Name, m_HardwareClass, m_Interface)
    DBusWakeupInterface->>DBusWakeupInterface: Determine key ("PS2M" for mouse, "PS2K" for keyboard)
    DBusWakeupInterface->>DBusWakeupInterface: Check wakeup state for correct device
Loading

Class diagram for updated DBusWakeupInterface and DeviceInput

classDiagram
    class DBusWakeupInterface {
        +bool setWakeupMachine(QString unique_id, QString path, bool wakeup, QString name, QString hardwareclass)
        +bool isInputWakeupMachine(QString path, QString name, QString hardwareClass, QString interfaceType)
    }
    class DeviceInput {
        +EnableDeviceStatus setEnable(bool e)
        +bool canWakeupMachine()
        +bool isWakeupMachine()
        -QString m_HardwareClass
        -QString m_Interface
    }
    DeviceInput --> DBusWakeupInterface : uses
Loading

File-Level Changes

Change Details Files
Extend DBusWakeupInterface API to differentiate device types
  • Added hardwareClass parameter to setWakeupMachine and isInputWakeupMachine
  • Replaced generic PS2 string detection with class-specific key selection ("PS2M" or "PS2K")
  • Removed old PS/2 checks and switched to new key variable
deepin-devicemanager/src/WakeupControl/DBusWakeupInterface.cpp
deepin-devicemanager/src/WakeupControl/DBusWakeupInterface.h
Propagate new parameters and simplify wakeup logic
  • Updated DeviceInput to pass m_HardwareClass and m_Interface into wakeup calls
  • Simplified DeviceInput::canWakeupMachine by removing redundant keyboard PS/2 branch
  • Adjusted UI code (TableWidget, PageSingleInfo, PageMultiInfo, TextBrowser) to supply hardwareClass and interfaceType
deepin-devicemanager/src/DeviceManager/DeviceInput.cpp
deepin-devicemanager/src/Widget/TableWidget.cpp
deepin-devicemanager/src/Page/PageSingleInfo.cpp
deepin-devicemanager/src/Page/PageMultiInfo.cpp
deepin-devicemanager/src/Widget/TextBrowser.cpp

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 and they look great!


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.

@GongHeng2017
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Oct 17, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 98b67c8 into linuxdeepin:develop/eagle Oct 17, 2025
16 of 18 checks passed
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