Skip to content

fix: uncomment activateWindow/showNormal calls - #873

Draft
add-uos wants to merge 2 commits into
linuxdeepin:masterfrom
add-uos:agent/bug/69fe28f3e3cf
Draft

add-uos wants to merge 2 commits into
linuxdeepin:masterfrom
add-uos:agent/bug/69fe28f3e3cf

Conversation

@add-uos

@add-uos add-uos commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

fix: uncomment activateWindow/showNormal calls

  1. Root cause: a single-line // comment silently disabled both
    activateWindow() and showNormal() in startDeviceManager
  2. Fix: uncomment both calls and split them onto separate lines to
    prevent future single-line comment from swallowing multiple statements
  3. Impact: minimized windows now properly restore and gain focus when
    startDeviceManager is called via D-Bus, consistent with the
    activateWindow() method already used in the same file

Log: Fixed window not restoring from minimized state when device manager is called again

Influence:

  1. Test calling startDeviceManager when window is minimized
  2. Verify window restores to normal state and gains focus
  3. Test calling startDeviceManager when window is already visible

fix: 恢复 startDeviceManager 中被注释的窗口激活调用

  1. 根因:第 87 行单行 // 注释同时吞掉了 activateWindow()
    和 showNormal() 两条调用,导致窗口最小化时无法被唤起
  2. 方案:取消注释并将两条调用拆分到独立行,从结构上消除单行
    注释吞掉多条语句的隐患
  3. 影响:最小化状态下再次调用 startDeviceManager 时窗口可正常
    恢复并激活,与同文件 activateWindow() 方法行为一致

Log: 修复设备管理器最小化状态下再次调用无法恢复窗口的问题

Influence:

  1. 测试窗口最小化时调用 startDeviceManager 的恢复行为
  2. 验证窗口恢复为正常状态并获得焦点
  3. 测试窗口已可见时调用 startDeviceManager 的行为

Summary by Sourcery

Ensure repeated device manager launches restore and activate the existing window.

Bug Fixes:

  • Restore and focus an existing device manager window when startDeviceManager is called, including when the window is minimized.

Chores:

  • Update the copyright year range for SingleDeviceManager.cpp.

@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates startDeviceManager so an existing minimized device manager window is restored to normal state and activated, while preserving the behavior for already visible windows.

Sequence diagram for restoring the device manager window

sequenceDiagram
    participant Caller
    participant SingleDeviceManager
    participant MainWindow

    Caller->>SingleDeviceManager: startDeviceManager(pageDescription)
    SingleDeviceManager->>MainWindow: setWindowState(...)
    SingleDeviceManager->>MainWindow: activateWindow()
    SingleDeviceManager->>MainWindow: showNormal()
Loading

File-Level Changes

Change Details Files
Restore and focus an existing device manager window when startDeviceManager is invoked.
  • Uncomment the existing activateWindow() and showNormal() calls.
  • Place each window-restoration call on its own line to avoid accidental comment suppression.
  • Retain the existing state update that clears minimization and marks the window active.
deepin-devicemanager/src/SingleDeviceManager.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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos

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

1. Root cause: a single-line `//` comment silently disabled both
   `activateWindow()` and `showNormal()` in startDeviceManager
2. Fix: uncomment both calls and split them onto separate lines to
   prevent future single-line comment from swallowing multiple statements
3. Impact: minimized windows now properly restore and gain focus when
   startDeviceManager is called via D-Bus, consistent with the
   `activateWindow()` method already used in the same file

Log: Fixed window not restoring from minimized state when device manager is called again

Influence:
1. Test calling startDeviceManager when window is minimized
2. Verify window restores to normal state and gains focus
3. Test calling startDeviceManager when window is already visible

fix: 恢复 startDeviceManager 中被注释的窗口激活调用

1. 根因:第 87 行单行 `//` 注释同时吞掉了 `activateWindow()`
   和 `showNormal()` 两条调用,导致窗口最小化时无法被唤起
2. 方案:取消注释并将两条调用拆分到独立行,从结构上消除单行
   注释吞掉多条语句的隐患
3. 影响:最小化状态下再次调用 startDeviceManager 时窗口可正常
   恢复并激活,与同文件 `activateWindow()` 方法行为一致

Log: 修复设备管理器最小化状态下再次调用无法恢复窗口的问题

Influence:
1. 测试窗口最小化时调用 startDeviceManager 的恢复行为
2. 验证窗口恢复为正常状态并获得焦点
3. 测试窗口已可见时调用 startDeviceManager 的行为
The license-check CI (SPDX Header Validation) requires files created in
earlier years and modified in 2026 to carry a copyright year range ending
with the current year. Extend the SPDX-FileCopyrightText header of
SingleDeviceManager.cpp from 2022 to 2022-2026 so the SPDX summary reports
0 failures.
@add-uos
add-uos force-pushed the agent/bug/69fe28f3e3cf branch from 85030dc to f797328 Compare October 27, 2026 03:45
@deepin-bot

deepin-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 6.0.75
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #956

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.

2 participants