Repository navigation
fix: preserve Dock behavior after display reconnection [cherry-pick] #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,8 +148,6 @@ | |
| void setCloseOnDismissed(bool close); | ||
| bool closeOnDismissed() const; | ||
|
|
||
| bool ensureWaylandShellIntegration(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Downstream consumers lose layer-shell API When a downstream consumer calls Retain the public declaration and exported implementation, or provide a compatible replacement. Prompt for AI agentsIn `frame/layershell/dlayershellwindow.h` at line 151:
**Downstream consumers lose layer-shell API**
When a downstream consumer calls `DLayerShellWindow::ensureWaylandShellIntegration()`, removing the public declaration makes downstream consumers fail to compile, and removing the exported symbol makes already-built consumers fail to load.
Retain the public declaration and exported implementation, or provide a compatible replacement. |
||
|
|
||
| /** Whether a system resize is pending or active on this layer surface. */ | ||
| bool isResizing() const; | ||
|
|
||
|
|
@@ -178,7 +176,9 @@ | |
| friend class QWaylandLayerShellSurface; | ||
| void setResizing(bool resizing); | ||
|
|
||
| bool eventFilter(QObject *watched, QEvent *event) override; | ||
| bool installWaylandShellIntegration(); | ||
| DLayerShellWindow(QWindow* window); | ||
|
Check warning on line 181 in frame/layershell/dlayershellwindow.h
|
||
| QScopedPointer<DLayerShellWindowPrivate> d; | ||
| }; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,11 +4,10 @@ | |
|
|
||
| #include "dockpanel.h" | ||
| #include "constants.h" | ||
| #include "dockadaptor.h" | ||
| #include "docksettings.h" | ||
| #include "layershell/dlayershellwindow.h" | ||
| #include "panel.h" | ||
| #include "pluginfactory.h" | ||
| #include "waylanddockhelper.h" | ||
| #include "x11dockhelper.h" | ||
|
|
||
|
|
@@ -512,8 +511,7 @@ | |
| auto *waylandScreen = dynamic_cast<QtWaylandClient::QWaylandScreen *>(primary->handle()); | ||
| if (!waylandScreen || !waylandScreen->output()) | ||
| return; | ||
| if (DS_NAMESPACE::DLayerShellWindow::get(win)->ensureWaylandShellIntegration()) | ||
| win->show(); | ||
| win->show(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Dock appears as ordinary window When layer-shell integration fails while Only call Prompt for AI agentsIn `panels/dock/dockpanel.cpp` at line 514:
**Dock appears as ordinary window**
When layer-shell integration fails while `updateDockScreen()` is showing the Dock, `win->show()` runs despite the failed integration, so the Dock is displayed with an ordinary shell role instead of remaining hidden or a layer surface.
Only call `win->show()` when layer-shell integration succeeds. |
||
| } | ||
|
|
||
| bool DockPanel::showInPrimary() const | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,6 +147,7 @@ WaylandDockHelper::WaylandDockHelper(DockPanel *panel) | |
|
|
||
| connect(m_panel, &DockPanel::positionChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::dockSizeChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
| connect(m_panel, &DockPanel::dockScreenChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High · Dock crashes without a screen When the last display is removed while a SmartHide region watch is active and the Dock window has no screen, Check that the window has a screen before dereferencing it, and defer updating the region watch until a screen is available. Prompt for AI agentsIn `panels/dock/waylanddockhelper.cpp` at line 150:
**Dock crashes without a screen**
When the last display is removed while a SmartHide region watch is active and the Dock window has no screen, `dockScreenChanged` invokes `updateRegionWatchPos()`, which dereferences `m_panel->window()->screen()` (and its handle) without checking for null, crashing the Dock during reconnection.
Check that the window has a screen before dereferencing it, and defer updating the region watch until a screen is available. |
||
| connect(m_panel, &DockPanel::rootObjectChanged, this, &WaylandDockHelper::updateRegionWatchPos); | ||
|
|
||
| auto ensureRegionWatch = [this]() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · XEmbed positioning uses stale surface
When display reconnection recreates the Dock’s Wayland platform surface and an XEmbed window is subsequently moved,
WaylandDockHelpercaches the Dock’swl_surfacebefore reconnection, but this restoration path does not refresh that cache when a new platform surface is created.moveXEmbedWindow()only reacquires the surface when the cached pointer is null, so a later XEmbed move sends the destroyed surface to Wayland instead of positioning the window.Refresh or clear the cached Dock surface when the platform surface is destroyed or created, before it can be used for XEmbed positioning.
Prompt for AI agents