Repository navigation
fix: preserve Dock behavior after display reconnection - #1891
Merged
Merged
Conversation
Reviewer's GuideImplementationRestore layer-shell integration when a Wayland platform window is recreated, and move that responsibility from DockPanel into DLayerShellWindow.
Refresh Dock edge wake areas when screens are added or the primary screen changes.
Rebind overlap monitoring when the Dock changes screens.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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="panels/dock/waylanddockhelper.cpp" line_range="150" />
<code_context>
connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos);
connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos);
+ connect(m_panel, &DockPanel::dockScreenChanged, this, &WaylandDockHelper::updateRegionWatchPos);
connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos);
</code_context>
<issue_to_address>
**Dock crashes without a screen**
When the last display is removed and the window has no screen, `dockScreenChanged` calls `updateRegionWatchPos()`, which dereferences `m_panel->window()->screen()` without checking it; the Dock crashes during disconnection.
Check that the window and its screen are non-null before dereferencing them in `updateRegionWatchPos()`.
</issue_to_address>
### Comment 2
<location path="panels/dock/dockpanel.cpp" line_range="514" />
<code_context>
if (!waylandScreen || !waylandScreen->output())
return;
- if (DS_NAMESPACE::DLayerShellWindow::get(win)->ensureWaylandShellIntegration())
- win->show();
+ win->show();
}
</code_context>
<issue_to_address>
**Dock appears without layer-shell integration**
When layer-shell integration fails during a primary-screen change, `updateDockScreen()` calls `win->show()` regardless of whether `installWaylandShellIntegration()` succeeded, so the window is mapped as an ordinary window instead of remaining hidden.
Show the window only after layer-shell integration succeeds.
Also at `frame/layershell/dlayershellwindow.cpp:287`.
</issue_to_address>
### Comment 3
<location path="frame/layershell/dlayershellwindow.h" line_range="151" />
<code_context>
void setCloseOnDismissed(bool close);
bool closeOnDismissed() const;
- bool ensureWaylandShellIntegration();
-
/** Whether a system resize is pending or active on this layer surface. */
</code_context>
<issue_to_address>
**Downstream callers no longer compile**
When an external consumer uses the previously public method, a downstream caller that invokes `DLayerShellWindow::ensureWaylandShellIntegration()` fails to compile because this public method is removed from the exported class.
Keep a public compatibility method that delegates to the new integration logic, or explicitly version the API break.
</issue_to_address>
### Comment 4
<location path="panels/dock/waylanddockhelper.cpp" line_range="150" />
<code_context>
connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos);
connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos);
+ connect(m_panel, &DockPanel::dockScreenChanged, this, &WaylandDockHelper::updateRegionWatchPos);
connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos);
</code_context>
<issue_to_address>
**Overlap monitoring stays on old screen**
When the Dock's logical screen changes before its QWindow screen is synchronized, when `dockScreenChanged` fires before `m_panel->window()->screen()` is synchronized, `updateRegionWatchPos()` reads the old screen and sends its output to `set_region()`. The later window-screen synchronization does not refresh the region watch, so smart-hide monitoring remains bound to the old output and the Dock can fail to hide on the new screen.
Rebind the region watch after the QWindow has moved to the new screen, or use the changed screen's output and ensure it is valid.
</issue_to_address>
|
gugullll
force-pushed
the
fix/hotplug2
branch
from
November 27, 2026 03:33
6bfc31f to
be82c74
Compare
18202781743
reviewed
Nov 27, 2026
18202781743
previously approved these changes
Nov 27, 2026
1. Restore layer-shell integration when platform windows are created. 2. Refresh edge wakeup areas when screens are added or primary changes. 3. Rebind overlap monitoring when the Dock changes screens. Influence: 1. Reconnect the only display and verify the Dock remains a layer surface. 2. In always-hidden mode, reconnect and reveal the Dock from the screen edge. 3. In smart-hide mode, reconnect with a maximized window and verify hiding. fix: 修复显示器重连后任务栏角色与隐藏行为异常 1. 平台窗口创建时自动恢复 layer-shell 集成,保留构造阶段补绑定。 2. 屏幕加入或主屏切换时更新边缘唤醒区域。 3. 任务栏切换屏幕时重新注册遮挡检测区域。 Influence: 1. 拔插唯一显示器,确认任务栏保持 layer-shell 角色。 2. 一直隐藏模式下重连显示器,确认可从屏幕边缘唤出任务栏。 3. 智能隐藏模式下保持窗口最大化并重连,确认任务栏恢复隐藏。 Log: Restore Dock window roles and hiding behavior after display reconnects. Log: 修复显示器重连后任务栏变成普通窗口、无法唤出或不再隐藏的问题。 Issue: None
gugullll
force-pushed
the
fix/hotplug2
branch
from
November 27, 2026 05:51
be82c74 to
9709656
Compare
18202781743
approved these changes
Nov 27, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, gugullll 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
该PR是对于 #1800 未覆盖全部show场景的调整。
Log: Restore Dock window roles and hiding behavior after display reconnects.
Influence:
fix: 修复显示器重连后任务栏角色与隐藏行为异常
Log: 修复显示器重连后任务栏变成普通窗口、无法唤出或不再隐藏的问题。
Influence:
Summary by Sourcery
Preserve Dock window roles, edge wakeup, and hiding behavior across display reconnects and screen changes.
Bug Fixes:
Enhancements: