Skip to content

refactor: replace PanelPopup with ApplicationWindow for windowed - #801

Open
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:task-394725
Open

refactor: replace PanelPopup with ApplicationWindow for windowed#801
wjyrich wants to merge 1 commit into
linuxdeepin:masterfrom
wjyrich:task-394725

Conversation

@wjyrich

@wjyrich wjyrich commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

launcher

  1. Replace PanelPopup with ApplicationWindow for the windowed launcher mode
  2. Refactor screen assignment logic into reusable functions (dockScreen/ assignDockScreen)
  3. Simplify fullscreen frame visibility logic in onViewDeactivated
  4. Add DLayerShellWindow properties for precise dock-relative positioning
  5. Add DWindow blur effects, theming, and border styling
  6. Implement blur-aware background with appearance-based opacity
  7. Add focus/active state handling with hide timer coordination

The windowed launcher previously used PanelPopup which has limited positioning and styling capabilities. The ApplicationWindow approach provides proper window management features like layer shell positioning, native blur effects, and atomic behavior control. The screen assignment refactoring improves code quality by separating screen detection from assignment.

Log: Improved windowed launcher mode with better positioning, blur effects, and focus handling

Influence:

  1. Test windowed launcher display on different dock positions (top/ bottom/left/right)
  2. Verify launcher positioning relative to dock and screen edges
  3. Test blur background effect in both light and dark themes
  4. Verify launcher hides when clicking outside or losing focus
  5. Test multi-screen scenarios with different screen configurations
  6. Verify windowed launchpad opens and closes correctly
  7. Test windowed launchpad with different dock spacing/thickness settings

refactor: 将窗口模式启动器从 PanelPopup 替换为 ApplicationWindow

  1. 将窗口模式启动器从 PanelPopup 替换为 ApplicationWindow
  2. 将屏幕分配逻辑重构为可复用函数(dockScreen/assignDockScreen)
  3. 简化 onViewDeactivated 中的全屏框架可见性逻辑
  4. 添加 DLayerShellWindow 属性以实现精确的坞站相对定位
  5. 添加 DWindow 模糊效果、主题和边框样式
  6. 实现基于外观透明度的模糊感知背景
  7. 添加焦点/激活状态处理与隐藏定时器协调

窗口模式启动器之前使用 PanelPopup,其定位和样式能力有限。
ApplicationWindow 方案提供了正确的窗口管理功能,如图层壳定位、原生模糊效
果和原子行为控制。屏幕分配重构通过分离屏幕检测与分配来提高代码质量。

Log: 改进窗口模式启动器,优化定位、模糊效果和焦点处理

Influence:

  1. 测试不同坞站位置(上/下/左/右)下窗口模式启动器的显示
  2. 验证启动器相对于坞站和屏幕边缘的定位
  3. 在浅色和深色主题中测试模糊背景效果
  4. 验证点击外部或失去焦点时启动器是否正确隐藏
  5. 测试不同屏幕配置下的多屏场景
  6. 验证窗口模式启动器的打开和关闭功能
  7. 测试不同坞站间距/厚度设置下的窗口模式启动器

PMS: TASK-394725

Summary by Sourcery

Modernize the windowed launcher with application-window behavior, precise dock-relative positioning, enhanced visual effects, and reliable focus handling.

New Features:

  • Replace the windowed launcher’s popup implementation with a window that supports dock-relative placement, native blur, theming, and border styling.
  • Add focus-aware activation and hide behavior for the windowed launcher.

Bug Fixes:

  • Ensure launcher windows are assigned to the dock’s screen across fullscreen and windowed modes.
  • Simplify launcher deactivation handling so visible launchers hide consistently.

Enhancements:

  • Refactor dock screen detection and assignment into reusable functions.
  • Improve windowed launcher positioning for different dock orientations, spacing, and thickness settings.
  • Coordinate window activation, popup closing, and hide timers for more predictable launcher behavior.

@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Reviewer's Guide

Refactors the windowed launcher from PanelPopup to ApplicationWindow, using layer-shell positioning, reusable dock-screen assignment, themed blur and border styling, and explicit focus/visibility lifecycle handling.

Sequence diagram for windowed launcher activation and focus handling

sequenceDiagram
    participant Controller as LauncherController
    participant Window as ApplicationWindow
    participant Screen as DockScreen
    participant Frame as WindowedFrame

    Controller->>Window: visible = true
    Window->>Screen: assignDockScreen(window)
    Window->>Window: requestActivate()
    Window->>Controller: closeAllPopups()
    Window->>Frame: display with layer-shell positioning
    alt window active
        Window->>Controller: cancelHide()
    else window inactive
        Window->>Controller: hideWithTimer()
    end
    Window->>Controller: onClosing sets visible = false
Loading

File-Level Changes

Change Details Files
Replaced the windowed launcher’s popup implementation with a layer-shell-backed application window.
  • Added native window flags, transparent rendering, and explicit window lifecycle handling.
  • Added dock-relative anchors and margins for all dock orientations, including spacing, thickness, and icon alignment.
  • Applied blur, theme-aware colors, shadows, rounded corners, and border styling.
shell-launcher-applet/package/launcheritem.qml
Centralized dock screen discovery and assignment for launcher windows.
  • Added reusable dockScreen and assignDockScreen helpers with null-safe dock handling.
  • Applied screen assignment to both fullscreen and windowed launcher instances during initialization and delayed updates.
shell-launcher-applet/package/launcheritem.qml
Refined launcher visibility and focus behavior around deactivation and window activation.
  • Hide any visible launcher on view deactivation instead of restricting the behavior to fullscreen mode.
  • Coordinate hide timers with application-window active state and preserve an opt-out for debugging.
  • Synchronize closing with LauncherController visibility and activate the window when shown.
shell-launcher-applet/package/launcheritem.qml

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="shell-launcher-applet/package/launcheritem.qml" line_range="286" />
<code_context>
-                                              launcher.itemPos.y + height / 2 * (Panel.position % 2),
-                                              width, height)
+        transientParent: null
+        flags: Qt.Window | Qt.FramelessWindowHint
+        color: "transparent"
+
</code_context>
<issue_to_address>
**issue (bug_risk):** The windowed launcher is now created with `Qt.Window | Qt.FramelessWindowHint` instead of a tool/popup-style window, so it is treated as a normal application window and can appear in task switching and window lists rather than remaining an auxiliary launcher window.

**Triggers:** When the desktop environment exposes ordinary application windows in the taskbar, dock window list, or Alt-Tab switcher.

**Suggested fix:** Include the appropriate tool/auxiliary-window flag, such as `Qt.Tool`, unless layer-shell integration explicitly suppresses normal window management for this window.
</issue_to_address>

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.

launcher.itemPos.y + height / 2 * (Panel.position % 2),
width, height)
transientParent: null
flags: Qt.Window | Qt.FramelessWindowHint

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): The windowed launcher is now created with Qt.Window | Qt.FramelessWindowHint instead of a tool/popup-style window, so it is treated as a normal application window and can appear in task switching and window lists rather than remaining an auxiliary launcher window.

Triggers: When the desktop environment exposes ordinary application windows in the taskbar, dock window list, or Alt-Tab switcher.

Suggested fix: Include the appropriate tool/auxiliary-window flag, such as Qt.Tool, unless layer-shell integration explicitly suppresses normal window management for this window.

Comment thread shell-launcher-applet/package/launcheritem.qml Outdated
Comment thread shell-launcher-applet/package/launcheritem.qml Outdated
Comment thread shell-launcher-applet/package/launcheritem.qml
BLumia
BLumia previously approved these changes Aug 25, 2026

@BLumia BLumia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

让山神也瞅瞅

18202781743
18202781743 previously approved these changes Aug 25, 2026
launcher

1. Replace PanelPopup with ApplicationWindow for the windowed launcher
mode
2. Refactor screen assignment logic into reusable functions (dockScreen/
assignDockScreen)
3. Simplify fullscreen frame visibility logic in onViewDeactivated
4. Add DLayerShellWindow properties for precise dock-relative
positioning
5. Add DWindow blur effects, theming, and border styling
6. Implement blur-aware background with appearance-based opacity
7. Add focus/active state handling with hide timer coordination

The windowed launcher previously used PanelPopup which has limited
positioning and styling capabilities. The ApplicationWindow approach
provides proper window management features like layer shell positioning,
native blur effects, and atomic behavior control. The screen assignment
refactoring improves code quality by separating screen detection from
assignment.

Log: Improved windowed launcher mode with better positioning, blur
effects, and focus handling

Influence:
1. Test windowed launcher display on different dock positions (top/
bottom/left/right)
2. Verify launcher positioning relative to dock and screen edges
3. Test blur background effect in both light and dark themes
4. Verify launcher hides when clicking outside or losing focus
5. Test multi-screen scenarios with different screen configurations
6. Verify windowed launchpad opens and closes correctly
7. Test windowed launchpad with different dock spacing/thickness
settings

refactor: 将窗口模式启动器从 PanelPopup 替换为 ApplicationWindow

1. 将窗口模式启动器从 PanelPopup 替换为 ApplicationWindow
2. 将屏幕分配逻辑重构为可复用函数(dockScreen/assignDockScreen)
3. 简化 onViewDeactivated 中的全屏框架可见性逻辑
4. 添加 DLayerShellWindow 属性以实现精确的坞站相对定位
5. 添加 DWindow 模糊效果、主题和边框样式
6. 实现基于外观透明度的模糊感知背景
7. 添加焦点/激活状态处理与隐藏定时器协调

窗口模式启动器之前使用 PanelPopup,其定位和样式能力有限。
ApplicationWindow 方案提供了正确的窗口管理功能,如图层壳定位、原生模糊效
果和原子行为控制。屏幕分配重构通过分离屏幕检测与分配来提高代码质量。

Log: 改进窗口模式启动器,优化定位、模糊效果和焦点处理

Influence:
1. 测试不同坞站位置(上/下/左/右)下窗口模式启动器的显示
2. 验证启动器相对于坞站和屏幕边缘的定位
3. 在浅色和深色主题中测试模糊背景效果
4. 验证点击外部或失去焦点时启动器是否正确隐藏
5. 测试不同屏幕配置下的多屏场景
6. 验证窗口模式启动器的打开和关闭功能
7. 测试不同坞站间距/厚度设置下的窗口模式启动器

PMS: TASK-394725
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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 similar comment
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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

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.

4 participants