Repository navigation
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideUses of the APICreate and remove one Wayland overlay per screen, and connect them to the existing low-power D-Bus adaptor.
Adapt low-power windows for per-screen fullscreen display and make the D-Bus Raise operation handle all visible windows without Wayland input grabs.
ImplementationImplement per-screen Wayland overlay lifecycle, privileged toplevel tagging, output targeting, and shortcut inhibition.
ConfigurationUse an explicit source list and configure Qt WaylandClient protocol generation and package build dependencies.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Replace the CMake source glob with an explicit source list and add Qt6 WaylandClient and wayland-protocols dependencies. 2. Generate xdg-toplevel-tag, xdg-shell and keyboard-shortcuts-inhibit protocol bindings for the client. 3. Create a fullscreen overlay window per QScreen on Wayland, tracked through screen added/removed signals. 4. Add WaylandOverlay to tag the toplevel as a privileged overlay and to force fullscreen on the target output. 5. Add ShortcutInhibition to block compositor shortcuts while the overlay is active. 6. Generalize LowPowerAdaptor to act on all visible top-level windows and skip mouse/keyboard grabs on Wayland. 7. Add wayland build dependencies to debian/control. Log: Implement per-screen fullscreen low-power overlays for Wayland sessions Influence: Low battery warning now covers every screen correctly under Wayland feat(lowpower): 支持 Wayland 下多屏低电量覆盖窗口 1. 用显式源文件列表替换 CMake 的源文件通配,并增加 Qt6 WaylandClient 与 wayland-protocols 依赖。 2. 为客户端生成 xdg-toplevel-tag、xdg-shell 和键盘快捷键抑制协议绑定。 3. 在 Wayland 下为每个 QScreen 创建全屏覆盖窗口,并跟踪屏幕增删信号。 4. 新增 WaylandOverlay,将顶层窗口标记为特权覆盖层并强制在目标输出上 全屏。 5. 新增 ShortcutInhibition,在覆盖窗口激活时屏蔽合成器快捷键。 6. 将 LowPowerAdaptor 泛化为作用于所有可见顶层窗口,并在 Wayland 下跳过 鼠标键盘抓取。 7. 在 debian/control 中增加 Wayland 构建依赖。 Log: 实现 Wayland 会话下按屏幕显示的全屏低电量覆盖窗口 Influence: Wayland 下低电量提示可正确覆盖所有屏幕 PMS: BUG-294681
312c4a0 to
795d849
Compare
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="dde-lowpower/src/main.cpp" line_range="79" />
<code_context>
+
+ it->second = std::make_unique<Window>(screen);
+ auto &overlay = *it->second;
+ overlay.winId();
+ new WaylandOverlay(overlay.windowHandle(), screen);
+ overlay.showFullScreen();
</code_context>
<issue_to_address>
**Compositor shortcuts remain available**
When qt creates the surface role while handling `overlay.winId()`, `WaylandOverlay` connects to `surfaceRoleCreated` after `overlay.winId()` creates the native window, so the signal is missed and `ShortcutInhibition::setSurface()` is never called; compositor shortcuts remain available over the warning.
Connect to surface-role creation before calling `overlay.winId()`, or otherwise handle a role that already exists.
Also at `dde-lowpower/src/waylandoverlay.cpp:37`.
</issue_to_address>
### Comment 2
<location path="dde-lowpower/src/shortcutinhibition.cpp" line_range="46" />
<code_context>
+
+void ShortcutInhibition::inhibitShortcuts()
+{
+ if (!isActive() || !m_surface || m_inhibitor) {
+ return;
+ }
</code_context>
<issue_to_address>
**Shortcuts stop being inhibited**
When the compositor removes and replaces its Wayland seat while an overlay inhibitor exists, `m_inhibitor` remains bound to the old seat, so the guard prevents `inhibitShortcuts()` from creating an inhibitor for the replacement seat and compositor shortcuts are no longer blocked for the overlay.
Track seat changes and clear and recreate the inhibitor for the current seat.
</issue_to_address>
### Comment 3
<location path="dde-lowpower/src/main.cpp" line_range="69" />
<code_context>
return 0;
+ }
+
+ if (a.platformName().startsWith(QLatin1String("wayland"))) {
+ a.setQuitOnLastWindowClosed(false);
+ const auto showOverlay = [&overlays](QScreen *screen) {
</code_context>
<issue_to_address>
**Legacy window covers the overlays**
When the lock front emits `Visible(true)` after startup, `HideShowToRaise()` schedules `show()` for the hidden legacy window without checking its visibility, so it appears and raises over the per-screen overlays, covering or duplicating the warning.
Prevent the legacy window’s lock-front `Visible` handler from showing or raising it during a Wayland session.
</issue_to_address>
### Comment 4
<location path="dde-lowpower/src/main.cpp" line_range="69" />
<code_context>
return 0;
+ }
+
+ if (a.platformName().startsWith(QLatin1String("wayland"))) {
+ a.setQuitOnLastWindowClosed(false);
+ const auto showOverlay = [&overlays](QScreen *screen) {
</code_context>
<issue_to_address>
**Hidden fallback window reappears**
When a `LockFront1.Visible(true)` signal arrives while the Wayland low-battery warning is running, `w` still has the `LockFront1.Visible` handler installed by its constructor, so a `Visible(true)` signal makes the hidden legacy window show alongside the per-screen overlays; users see an extra, non-fullscreen warning window.
Disable the lock-front show handler on the unused Wayland fallback window, or avoid constructing that window for Wayland sessions.
</issue_to_address>|
|
||
| it->second = std::make_unique<Window>(screen); | ||
| auto &overlay = *it->second; | ||
| overlay.winId(); |
There was a problem hiding this comment.
🟡 Medium · Compositor shortcuts remain available
When qt creates the surface role while handling overlay.winId(), WaylandOverlay connects to surfaceRoleCreated after overlay.winId() creates the native window, so the signal is missed and ShortcutInhibition::setSurface() is never called; compositor shortcuts remain available over the warning.
Connect to surface-role creation before calling overlay.winId(), or otherwise handle a role that already exists.
Also at dde-lowpower/src/waylandoverlay.cpp:37.
Prompt for AI agents
In `dde-lowpower/src/main.cpp` at line 79:
**Compositor shortcuts remain available**
When qt creates the surface role while handling `overlay.winId()`, `WaylandOverlay` connects to `surfaceRoleCreated` after `overlay.winId()` creates the native window, so the signal is missed and `ShortcutInhibition::setSurface()` is never called; compositor shortcuts remain available over the warning.
Connect to surface-role creation before calling `overlay.winId()`, or otherwise handle a role that already exists.
Also at `dde-lowpower/src/waylandoverlay.cpp:37`.|
|
||
| void ShortcutInhibition::inhibitShortcuts() | ||
| { | ||
| if (!isActive() || !m_surface || m_inhibitor) { |
There was a problem hiding this comment.
🟡 Medium · Shortcuts stop being inhibited
When the compositor removes and replaces its Wayland seat while an overlay inhibitor exists, m_inhibitor remains bound to the old seat, so the guard prevents inhibitShortcuts() from creating an inhibitor for the replacement seat and compositor shortcuts are no longer blocked for the overlay.
Track seat changes and clear and recreate the inhibitor for the current seat.
Prompt for AI agents
In `dde-lowpower/src/shortcutinhibition.cpp` at line 46:
**Shortcuts stop being inhibited**
When the compositor removes and replaces its Wayland seat while an overlay inhibitor exists, `m_inhibitor` remains bound to the old seat, so the guard prevents `inhibitShortcuts()` from creating an inhibitor for the replacement seat and compositor shortcuts are no longer blocked for the overlay.
Track seat changes and clear and recreate the inhibitor for the current seat.| return 0; | ||
| } | ||
|
|
||
| if (a.platformName().startsWith(QLatin1String("wayland"))) { |
There was a problem hiding this comment.
🟠 High · Legacy window covers the overlays
When the lock front emits Visible(true) after startup, HideShowToRaise() schedules show() for the hidden legacy window without checking its visibility, so it appears and raises over the per-screen overlays, covering or duplicating the warning.
Prevent the legacy window’s lock-front Visible handler from showing or raising it during a Wayland session.
Prompt for AI agents
In `dde-lowpower/src/main.cpp` at line 69:
**Legacy window covers the overlays**
When the lock front emits `Visible(true)` after startup, `HideShowToRaise()` schedules `show()` for the hidden legacy window without checking its visibility, so it appears and raises over the per-screen overlays, covering or duplicating the warning.
Prevent the legacy window’s lock-front `Visible` handler from showing or raising it during a Wayland session.| return 0; | ||
| } | ||
|
|
||
| if (a.platformName().startsWith(QLatin1String("wayland"))) { |
There was a problem hiding this comment.
🟡 Medium · Hidden fallback window reappears
When a LockFront1.Visible(true) signal arrives while the Wayland low-battery warning is running, w still has the LockFront1.Visible handler installed by its constructor, so a Visible(true) signal makes the hidden legacy window show alongside the per-screen overlays; users see an extra, non-fullscreen warning window.
Disable the lock-front show handler on the unused Wayland fallback window, or avoid constructing that window for Wayland sessions.
Prompt for AI agents
In `dde-lowpower/src/main.cpp` at line 69:
**Hidden fallback window reappears**
When a `LockFront1.Visible(true)` signal arrives while the Wayland low-battery warning is running, `w` still has the `LockFront1.Visible` handler installed by its constructor, so a `Visible(true)` signal makes the hidden legacy window show alongside the per-screen overlays; users see an extra, non-fullscreen warning window.
Disable the lock-front show handler on the unused Wayland fallback window, or avoid constructing that window for Wayland sessions.
Log: Implement per-screen fullscreen low-power overlays for Wayland sessions
Influence: Low battery warning now covers every screen correctly under Wayland
feat(lowpower): 支持 Wayland 下多屏低电量覆盖窗口
Log: 实现 Wayland 会话下按屏幕显示的全屏低电量覆盖窗口
Influence: Wayland 下低电量提示可正确覆盖所有屏幕
PMS: BUG-294681
Summary by Sourcery
Display and manage fullscreen low-power warning overlays on every screen in Wayland sessions.
New Features:
Bug Fixes:
Enhancements:
Build:
Chores: