Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideData structuresAdd the platform handle and per-screen window state needed to manage Wayland overlays.
ImplementationImplement platform-specific fullscreen sizing, Wayland layer-shell setup, dynamic screen coverage, and overlay visibility lifecycle while preserving the X11 behavior.
ConfigurationDiscover and link DDEShell so the low-power target can use Wayland layer-shell support.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 5 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="dde-lowpower/src/window.cpp" line_range="137" />
<code_context>
+ move(primaryGeometry.topLeft());
+ }
+ if (size() != primaryGeometry.size()) {
+ setFixedSize(primaryGeometry.size());
+ }
+
</code_context>
<issue_to_address>
**Low-battery message disappears**
When the cursor is on a secondary screen or the primary screen has a nonzero virtual origin, `setupSize()` positions the image and text using screen-global coordinates as child-local coordinates, while `updateScreenWindows()` places the main window on the primary screen. The content lands outside the main window, and the secondary screen’s cover is black, so the low-battery message is missing.
Position the image and text using coordinates local to the main window, accounting for the window’s primary-screen position.
Also at `dde-lowpower/src/window.cpp:134`.
</issue_to_address>
### Comment 2
<location path="dde-lowpower/src/window.cpp" line_range="121" />
<code_context>
+void Window::updateScreenWindows()
+{
+ const QList<QScreen *> screens = qApp->screens();
+ if (screens.isEmpty()) {
+ return;
</code_context>
<issue_to_address>
**Changed displays remain uncovered**
When a screen is added, removed, resized, or rearranged while the overlay is visible, `updateScreenWindows()` only refreshes the cover windows during setup or show, and no topology or geometry-change handler calls it afterward. The cover windows retain stale sizes and positions or are missing, leaving desktop content exposed.
Refresh the cover windows when screens are added, removed, or have their geometry changed.
Also at `dde-lowpower/src/window.cpp:84`, `dde-lowpower/src/window.cpp:208-209`.
</issue_to_address>
### Comment 3
<location path="dde-lowpower/src/window.cpp" line_range="223-226" />
<code_context>
+ case QEvent::WindowDeactivate:
+ // Wayland: compositor may deactivate the window, re-raise after delay
+ if (!isHidden()) {
+ QTimer::singleShot(30, this, [this]() {
+ raise();
+ activateWindow();
+ setScreenWindowsVisible(true);
+ });
+ }
</code_context>
<issue_to_address>
**Hidden overlay leaves black screens**
When the main window is hidden during the 30 ms delay after `WindowDeactivate`, the delayed callback calls `setScreenWindowsVisible(true)` without checking whether the main window is still visible. The independent cover windows reappear while the main window stays hidden, leaving black screens visible.
Check that the main window is still visible before raising it or showing the cover windows in the delayed callback.
</issue_to_address>
### Comment 4
<location path="dde-lowpower/src/window.cpp" line_range="167-177" />
<code_context>
+ }
+
+ int coverIndex = 0;
+ for (QScreen *screen : screens) {
+ if (screen == primaryScreen) {
+ continue;
+ }
+
+ QWidget *screenWindow = m_screenWindows.at(coverIndex++);
</code_context>
<issue_to_address>
**Mirrored display hides the warning**
When the Wayland session is in mirrored/copy display mode and Qt reports multiple screens with the same geometry, `updateScreenWindows()` creates a black cover window for every screen except the primary and raises it over the main window. In mirror mode, screens share the same geometry, so the extra cover window obscures the low-battery image and text on the mirrored display.
Detect mirrored screens and avoid creating a separate black cover window for a screen whose geometry duplicates the primary screen.
</issue_to_address>
### Comment 5
<location path="dde-lowpower/src/window.cpp" line_range="221-227" />
<code_context>
+ }
+ break;
+ case QEvent::WindowDeactivate:
+ // Wayland: compositor may deactivate the window, re-raise after delay
+ if (!isHidden()) {
+ QTimer::singleShot(30, this, [this]() {
+ raise();
+ activateWindow();
+ setScreenWindowsVisible(true);
+ });
+ }
+ break;
</code_context>
<issue_to_address>
**X11 overlay steals focus back**
When the overlay loses activation on X11, the `WindowDeactivate` handler schedules `raise()` and `activateWindow()` without checking the platform, so an X11 window that loses activation takes focus back 30 ms later. Users cannot keep another window active while the low-power overlay is running, despite X11 being intended to retain its prior behavior.
Restrict the delayed re-raise behavior to non-X11 platforms, or otherwise preserve the previous X11 deactivation behavior.
</issue_to_address>7ffca9a to
c954e93
Compare
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
- Support Wayland multi-screen fullscreen overlay - Use LayerOverlay and fix window radius for Treeland - Fix include case and add null check for DLayerShellWindow - Set exclusive zone -1 to cover full screen in Treeland Log: Fix low power screensaver not covering full screen in Treeland environment Bug: https://pms.uniontech.com/bug-view-294681.html
2499043 to
0480f49
Compare
treeland 环境下低电量屏保未铺满整个屏幕,根因是 window.cpp 无条件使用
Qt::X11BypassWindowManagerHint(Wayland 下被忽略),修复方案参照 dde-blackwidget 的 Wayland 兼容实现。
Log: 修复treeland环境下低电量屏保未铺满整个屏幕的问题
PMS: BUG-294681
Summary by Sourcery
Enable low-power fullscreen overlays to cover all monitors reliably on Wayland while retaining X11 compatibility.
New Features:
Bug Fixes:
Enhancements:
Build: