Skip to content

fix(notification): prevent bubble window from taking focus - #1731

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
mhduiy:fix/notification-bubble-focus
Sep 10, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
mhduiy:fix/notification-bubble-focus

Conversation

@mhduiy

@mhduiy mhduiy commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The notification banner window steals keyboard focus from the active window when a notification pops up. Add Qt.WindowDoesNotAcceptFocus so the banner never grabs focus, matching the dock and OSD windows which already use this flag.

  • Add Qt.WindowDoesNotAcceptFocus to the bubble window flags
  • The banner remains interactive (hover/click close, action buttons) — the flag only suppresses focus

Log

Notification banner window no longer takes focus

Influence

Active window keeps focus when a banner appears

PMS: BUG-375861

Summary by Sourcery

Bug Fixes:

  • Prevent notification banner windows from stealing focus from the active application when they appear.

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR makes notification banners non-focusable by applying Qt.WindowDoesNotAcceptFocus, adds a platform-name guard for screen-lock initialization in tests, and introduces an automated workflow to generate and optionally submit Debian changelog updates.

Flow diagram for non-focusable notification banners

flowchart LR
    N[Notification appears] --> B[Bubble window]
    B --> F[Qt.WindowDoesNotAcceptFocus]
    F --> A[Active window keeps keyboard focus]
    B --> I[Hover, close, and action buttons remain interactive]
Loading

Flow diagram for automated Debian changelog updates

flowchart LR
    T[Workflow dispatch or reusable workflow call] --> C[Checkout base branch]
    C --> P[Prepare changelog data]
    P --> G[Generate changelog]
    G --> D{create_pr enabled}
    D -->|yes| R[Create pull request]
    D -->|no| U[Upload generated changelog artifact]
Loading

File-Level Changes

Change Details Files
Prevent notification bubbles from activating the keyboard-focused window while preserving normal banner interaction.
  • Set the QML window flag to reject focus.
  • Retain hover, click-to-close, and action-button interaction through the non-focusable window behavior.
panels/notification/bubble/package/main.qml
Avoid initializing screen-lock state when the Qt platform name is unavailable, supporting unit-test environments.
  • Guard screen-lock initialization with a non-empty platform-name check.
  • Document the test-related rationale and future login1 migration.
panels/notification/server/notificationmanager.cpp
Add a manually invokable or reusable GitHub Actions workflow for generating and optionally opening changelog update pull requests.
  • Support version, branch, distribution, and PR-creation inputs for manual and reusable invocations.
  • Derive versions, collect commit titles since the last changelog change, and generate Debian changelog entries.
  • Either upload the generated changelog as an artifact or create an automated pull request with appropriate permissions.
.github/workflows/update-changelog.yml

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/update-changelog.yml" line_range="41" />
<code_context>
+      create_pr:
+        required: false
+        type: boolean
+        default: true
+    secrets:
+      APP_ID:
</code_context>
<issue_to_address>
**issue (bug_risk):** A reusable workflow call that omits `create_pr` defaults to `true`, but `APP_ID` and `APP_PRIVATE_KEY` are optional; without those secrets, the app-token step fails and the changelog job cannot create the pull request. The pull-request step also passes only the app-token output rather than falling back to `github.token`.

**Triggers:** When another workflow invokes `workflow_call` without supplying the optional GitHub App secrets.

**Suggested fix:** Default `create_pr` to false unless app credentials are guaranteed, or use the fallback token for the pull-request step and validate the required credentials when PR creation is requested.

```suggestion
        default: false
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/update-changelog.yml Outdated
1. Add Qt.WindowDoesNotAcceptFocus flag to the bubble window
2. Align with dock and OSD windows that already suppress focus stealing
3. Notification popup no longer grabs focus from the active window

Log: Notification banner window no longer takes focus
Influence: Active window keeps focus when a banner appears

fix(notification): 通知横幅窗口不再抢占焦点

1. 为横幅窗口添加 Qt.WindowDoesNotAcceptFocus 标志
2. 与停靠栏、OSD 窗口保持一致,抑制焦点抢占
3. 通知弹出时活动窗口焦点保持不变

Log: 通知横幅弹出时不再抢占活动窗口焦点
PMS: BUG-375861
Influence: 通知横幅弹出时活动窗口保持焦点
Change-Id: Ifd3ba9abd70dae62e2db3703e7d5c70658173b3f
@mhduiy
mhduiy force-pushed the fix/notification-bubble-focus branch from 7da7386 to de87e6b Compare September 10, 2026 07:15
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 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

@mhduiy

mhduiy commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit 4cbccba into linuxdeepin:master Sep 10, 2026
6 of 10 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