Skip to content

fix: keep X11 layer shell windows on their screen - #1894

Merged
robertkill merged 1 commit into
linuxdeepin:masterfrom
robertkill:fix/bug-384699-layershell-screen
Nov 27, 2026
Merged

robertkill merged 1 commit into
linuxdeepin:masterfrom
robertkill:fix/bug-384699-layershell-screen

Conversation

@robertkill

@robertkill robertkill commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On X11, when layer-shell margins push a window completely off its screen (e.g. moving the dock to the left on dual screens with 125% scaling), Qt reassigns the window to the neighbouring screen; onPositionChanged() re-enters with the new screen origin and the window ping-pongs between screens forever, freezing dde-shell.

After the final geometry is computed (including opposite anchors), this change moves an axis back only when the window center leaves the current screen on that axis — the same rule Qt uses (QWindowPrivate::screenForGeometry) to pick the window's screen. A window larger than the screen is centered on it. Intentional partial overlap (the full-height notification bubble shifted up to avoid a bottom dock) is preserved.

Verification

  • Geometry check compiling the real onPositionChanged() body against Qt QRect: launchpad with oversized margin on primary/secondary screen, notification avoiding bottom/right dock, dock with opposite anchors, center crossing into the neighbour while still overlapping, opposite anchors with negative margins, window wider than its screen — 9/9 pass. A randomized check (300k cases, two-screen layouts, Qt 6.8 screen-selection rule) verifies the center always stays on the current screen, placement is idempotent and settles in ≤2 passes on the original screen, sizes are unchanged, and axes upstream already kept on screen are untouched; upstream loops or switches screens in 14,142 of them.
  • Full CTest on this branch (base 20dd983e): 300 passed, 1 pre-existing disabled.
  • Real dual-screen 125% X11 machine (same function body on the 2.0.61 base, first revision of this fix): unpatched freezes at 113.9% CPU when switching the dock bottom→left; patched switches normally (CPU 0–4.4%), all four positions and the windowed launcher work, and a notification stays 60 px above the bottom dock.

Not covered: Wayland, notification click actions, third-party plugins. The real-machine run used the 2.0.61 base; onPositionChanged() is byte-identical on both bases.

PMS: BUG-384699

@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Clamp an axis back onto the current screen only when the window center leaves it, preventing screen reassignment loops while preserving intentional partial overlap.

  • frame/layershell/x11dlayershellemulation.cpp L226-241

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 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="214-215" />
<code_context>

     QRect rect(x, y, targetWidth, targetHeight);
+    // Prevent screen-change feedback without discarding intentional partial overlap (e.g. notifications).
+    if (rect.left() > screenRect.right() || rect.right() < screenRect.left()) {
+        rect.moveLeft(qMax(screenRect.left(), qMin(x, screenRect.right() + 1 - targetWidth)));
+    }
+    if (rect.top() > screenRect.bottom() || rect.bottom() < screenRect.top()) {
</code_context>
<issue_to_address>
**Off-screen geometry triggers reassignment**

When both opposing anchors are set on an axis and the margins produce a positive-size rectangle wholly outside the screen, `onPositionChanged()` clamps `rect`, but the later opposing-anchor geometry calculation resets its position and size from the margins. Qt can then reassign the window and re-enter positioning without the clamp taking effect.

Apply the clamp to the final geometry after the opposing-anchor calculation.
</issue_to_address>

### Comment 2
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="215" />
<code_context>
     QRect rect(x, y, targetWidth, targetHeight);
+    // Prevent screen-change feedback without discarding intentional partial overlap (e.g. notifications).
+    if (rect.left() > screenRect.right() || rect.right() < screenRect.left()) {
+        rect.moveLeft(qMax(screenRect.left(), qMin(x, screenRect.right() + 1 - targetWidth)));
+    }
+    if (rect.top() > screenRect.bottom() || rect.bottom() < screenRect.top()) {
</code_context>
<issue_to_address>
**Oversized windows leave their screen**

When a layer-shell window is wider than its screen and its position would otherwise be completely outside it, the clamp puts the oversized rectangle's left edge at the screen's left edge but does not keep its center on that screen. Qt can assign the window to a neighboring screen, so subsequent positioning uses that screen's origin and moves the window away from the requested screen.

For dimensions larger than the screen, choose a position that keeps the window associated with the current screen (for example, keep its center there) instead of only clamping its left edge.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@deepin-ci-robot

deepin-ci-robot commented Nov 27, 2026 •

Copy link
Copy Markdown

⚠️ OBS CI 构建警告日志 (Commit: a4bc0f05)

提示:以下为 OBS CI 构建中 Lintian 检测到的警告信息,默认折叠,点击展开查看详情。完整日志请参阅对应构建状态链接。

deepin_develop / aarch64 (Lintian 警告: 15 条)
[ 1032s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[ 1032s] N: 
[ 1032s] N:   The desktop entry specifies a Command that does not match any of the
[ 1032s] N:   executables shipped in the package.
[ 1032s] N:   
[ 1032s] N:   This condition is often caused by a typo, or the desktop file was not
[ 1032s] N:   updated after the installed path of the executable was modified.
[ 1032s] N:   
[ 1032s] N:   Packages should ship executables that are used as commands in desktop
[ 1032s] N:   files.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: menu-format
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/aarch64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/aarch64-linux-gnu/libds-notification-shared.so]
[ 1032s] N: 
[ 1032s] N:   Although this package is not a "-dev" package, it installs a
[ 1032s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[ 1032s] N:   library. When the link doesn't include the version number, it is used by
[ 1032s] N:   the linker when other programs are built against this shared library.
[ 1032s] N:   
[ 1032s] N:   Shared libraries are supposed to place such symbolic links in their
[ 1032s] N:   respective "-dev" packages, so it is a bug to include it with the main
[ 1032s] N:   library package.
[ 1032s] N:   
[ 1032s] N:   However, if this is a small package which includes the runtime and the
[ 1032s] N:   development libraries, this is not a bug. In the latter case, please
[ 1032s] N:   override this warning.
[ 1032s] N: 
[ 1032s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[ 1032s] N:   Manual for details.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: libraries/shared/links
[ 1032s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[ 1032s] N: 
[ 1032s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[ 1032s] N:   a manual page
[ 1032s] N:   
[ 1032s] N:   Note that though the man program has the capability to check for several
[ 1032s] N:   program names in the NAMES section, each of these programs should have its
[ 1032s] N:   own manual page (a symbolic link to the appropriate manual page is
[ 1032s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[ 1032s] N:   support this.
[ 1032s] N:   
[ 1032s] N:   If the name of the manual page differs from the binary by case, man may be
[ 1032s] N:   able to find it anyway; however, it is still best practice to match the
[ 1032s] N:   exact capitalization of the executable in the manual page.
[ 1032s] N:   
[ 1032s] N:   If the manual pages are provided by another package on which this package
[ 1032s] N:   depends, Lintian may not be able to determine that manual pages are
[ 1032s] N:   available. In this case, after confirming that all binaries do have manual
[ 1032s] N:   pages after this package and its dependencies are installed, please add a
[ 1032s] N:   Lintian override.
[ 1032s] N: 
[ 1032s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[ 1032s] N:   for details.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: documentation/manual
[ 1032s] N:   Renamed from: binary-without-manpage
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[ 1032s] N: 
[ 1032s] N:   When you NMU a package, that fact should be mentioned on the first line in
[ 1032s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[ 1032s] N:   insensitive).
[ 1032s] N:   
[ 1032s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[ 1032s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[ 1032s] N:   identical to the maintainer or one of the uploaders. If this is a local
[ 1032s] N:   package (not intended for Debian), you can suppress this warning by
[ 1032s] N:   putting "local" in the version number or "local package" on the first line
[ 1032s] N:   of the changelog entry.
[ 1032s] N: 
[ 1032s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[ 1032s] N:   Developer's Reference for details.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: nmu
[ 1032s] N:   Renamed from: changelog-should-mention-nmu
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[ 1032s] N: 
[ 1032s] N:   The package name of a library package should usually reflect the soname of
[ 1032s] N:   the included library. The package name can determined from the library
[ 1032s] N:   file name with the following code snippet:
[ 1032s] N:   
[ 1032s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[ 1032s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: libraries/shared/soname
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[ 1032s] N:
[ 1032s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[ 1032s] N:
[ 1032s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u057 [debian/changelog:1]
[ 1032s] N: 
[ 1032s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[ 1032s] N:   native package). This is to prevent stealing version numbers from the
[ 1032s] N:   maintainer.
[ 1032s] N:   
[ 1032s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[ 1032s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[ 1032s] N:   identical to the maintainer or one of the uploaders. If this is a local
[ 1032s] N:   package (not intended for Debian), you can suppress this warning by
[ 1032s] N:   putting "local" in the version number or "local package" on the first line
[ 1032s] N:   of the changelog entry.
[ 1032s] N: 
[ 1032s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[ 1032s] N:   Developer's Reference for details.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: nmu
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell: unknown-section DDE
[ 1032s] N: 
[ 1032s] N:   The "Section:" field in this package's control file is not one of the
[ 1032s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[ 1032s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[ 1032s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[ 1032s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[ 1032s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[ 1032s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[ 1032s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[ 1032s] N:   
[ 1032s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[ 1032s] N:   "non-free-firmware/" if the package is in the according archive area.
[ 1032s] N: 
[ 1032s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[ 1032s] N:   details.
[ 1032s] N: 
[ 1032s] N:   Visibility: warning
[ 1032s] N:   Show-Always: no
[ 1032s] N:   Check: fields/section
[ 1032s] N: 
[ 1032s] N:
[ 1032s] W: dde-shell-example: unknown-section DDE
[ 1032s] N:
[ 1032s] W: libdde-shell: unknown-section DDE
[ 1032s] N:
[ 1032s] W: libdde-shell-dev: unknown-section DDE
[ 1032s] N:
[ 1032s] W: libdde-shell-dock: unknown-section DDE
[ 1032s] N:
[ 1032s] W: libdde-shell-dock-dev: unknown-section DDE
[ 1033s] Warning: mkbaselibs missing in build root, skipping baselibs
deepin_develop / x86_64 (Lintian 警告: 15 条)
[  639s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[  639s] N: 
[  639s] N:   The desktop entry specifies a Command that does not match any of the
[  639s] N:   executables shipped in the package.
[  639s] N:   
[  639s] N:   This condition is often caused by a typo, or the desktop file was not
[  639s] N:   updated after the installed path of the executable was modified.
[  639s] N:   
[  639s] N:   Packages should ship executables that are used as commands in desktop
[  639s] N:   files.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: menu-format
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/x86_64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/x86_64-linux-gnu/libds-notification-shared.so]
[  639s] N: 
[  639s] N:   Although this package is not a "-dev" package, it installs a
[  639s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  639s] N:   library. When the link doesn't include the version number, it is used by
[  639s] N:   the linker when other programs are built against this shared library.
[  639s] N:   
[  639s] N:   Shared libraries are supposed to place such symbolic links in their
[  639s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  639s] N:   library package.
[  639s] N:   
[  639s] N:   However, if this is a small package which includes the runtime and the
[  639s] N:   development libraries, this is not a bug. In the latter case, please
[  639s] N:   override this warning.
[  639s] N: 
[  639s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  639s] N:   Manual for details.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: libraries/shared/links
[  639s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  639s] N: 
[  639s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  639s] N:   a manual page
[  639s] N:   
[  639s] N:   Note that though the man program has the capability to check for several
[  639s] N:   program names in the NAMES section, each of these programs should have its
[  639s] N:   own manual page (a symbolic link to the appropriate manual page is
[  639s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  639s] N:   support this.
[  639s] N:   
[  639s] N:   If the name of the manual page differs from the binary by case, man may be
[  639s] N:   able to find it anyway; however, it is still best practice to match the
[  639s] N:   exact capitalization of the executable in the manual page.
[  639s] N:   
[  639s] N:   If the manual pages are provided by another package on which this package
[  639s] N:   depends, Lintian may not be able to determine that manual pages are
[  639s] N:   available. In this case, after confirming that all binaries do have manual
[  639s] N:   pages after this package and its dependencies are installed, please add a
[  639s] N:   Lintian override.
[  639s] N: 
[  639s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  639s] N:   for details.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: documentation/manual
[  639s] N:   Renamed from: binary-without-manpage
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  639s] N: 
[  639s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  639s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  639s] N:   insensitive).
[  639s] N:   
[  639s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  639s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  639s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  639s] N:   package (not intended for Debian), you can suppress this warning by
[  639s] N:   putting "local" in the version number or "local package" on the first line
[  639s] N:   of the changelog entry.
[  639s] N: 
[  639s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  639s] N:   Developer's Reference for details.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: nmu
[  639s] N:   Renamed from: changelog-should-mention-nmu
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  639s] N: 
[  639s] N:   The package name of a library package should usually reflect the soname of
[  639s] N:   the included library. The package name can determined from the library
[  639s] N:   file name with the following code snippet:
[  639s] N:   
[  639s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  639s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: libraries/shared/soname
[  639s] N: 
[  639s] N:
[  639s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  639s] N:
[  639s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  639s] N:
[  639s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u057 [debian/changelog:1]
[  639s] N: 
[  639s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  639s] N:   native package). This is to prevent stealing version numbers from the
[  639s] N:   maintainer.
[  639s] N:   
[  639s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  639s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  639s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  639s] N:   package (not intended for Debian), you can suppress this warning by
[  639s] N:   putting "local" in the version number or "local package" on the first line
[  639s] N:   of the changelog entry.
[  639s] N: 
[  639s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  639s] N:   Developer's Reference for details.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: nmu
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell: unknown-section DDE
[  639s] N: 
[  639s] N:   The "Section:" field in this package's control file is not one of the
[  639s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  639s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  639s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  639s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  639s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  639s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  639s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  639s] N:   
[  639s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  639s] N:   "non-free-firmware/" if the package is in the according archive area.
[  639s] N: 
[  639s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  639s] N:   details.
[  639s] N: 
[  639s] N:   Visibility: warning
[  639s] N:   Show-Always: no
[  639s] N:   Check: fields/section
[  639s] N: 
[  639s] N:
[  639s] W: dde-shell-example: unknown-section DDE
[  639s] N:
[  639s] W: libdde-shell: unknown-section DDE
[  639s] N:
[  639s] W: libdde-shell-dev: unknown-section DDE
[  639s] N:
[  639s] W: libdde-shell-dock: unknown-section DDE
[  639s] N:
[  639s] W: libdde-shell-dock-dev: unknown-section DDE
[  640s] Warning: mkbaselibs missing in build root, skipping baselibs

1. When margins push an X11 layer shell window completely off its
   screen, Qt reassigns it to the neighbouring screen and positioning
   re-enters with the new origin, ping-ponging between screens forever
   and freezing dde-shell (e.g. moving the dock to the left on dual
   screens with 125% scaling).
2. After the final geometry is computed (including opposite anchors),
   move an axis back only when the window center leaves the current
   screen on that axis, matching how Qt picks the window's screen; a
   window larger than the screen is centered on it. Intentional partial
   overlap such as the full-height notification bubble avoiding the dock
   is preserved.

Influence:
1. On dual screens with scaling, switch the dock between bottom, left,
   top and right from the context menu; dde-shell must not freeze
2. Open and close the windowed launcher on primary and secondary screens
3. With the dock at the bottom or right, send a notification and verify
   it does not overlap the dock

fix: X11 下 layer shell 窗口保持在所在屏幕

1. 边距把 X11 layer shell 窗口完全推出所在屏幕时,Qt 会把窗口改归相邻屏幕,
   定位逻辑以新屏幕原点再次进入,在两块屏幕间反复切换,导致 dde-shell 卡死
   (如双屏 125% 缩放下将任务栏切到左侧)
2. 在最终几何(含两侧锚定)计算完成后,仅当窗口中心在某一轴上离开当前屏幕时
   才把该轴拉回,与 Qt 按中心点判定所属屏幕一致;比屏幕大的窗口居中于当前屏幕。
   保留通知气泡等有意的部分越界以避让任务栏

Influence:
1. 双屏缩放环境下通过右键菜单在底部、左侧、顶部、右侧间切换任务栏位置,dde-shell 不卡死
2. 在主副屏打开、关闭窗口模式启动器
3. 任务栏位于底部或右侧时发送通知,确认通知不与任务栏重叠

Log: 修复双屏缩放下切换任务栏位置导致界面卡死的问题
PMS: BUG-384699
@robertkill
robertkill force-pushed the fix/bug-384699-layershell-screen branch from 7cab148 to a4bc0f0 Compare November 27, 2026 07:15
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, robertkill

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

@robertkill
robertkill merged commit 61d5816 into linuxdeepin:master Nov 27, 2026
13 of 14 checks passed
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.

3 participants