Skip to content

fix: add skip switcher hint for X11 layer shell - #1828

Merged
18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:bugfix
Nov 19, 2026
Merged

18202781743 merged 1 commit into
linuxdeepin:masterfrom
18202781743:bugfix

Conversation

@18202781743

@18202781743 18202781743 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor
  1. Add setSkipSwitcher() helper to append
    _KDE_NET_WM_STATE_SKIP_SWITCHER to the _NET_WM_STATE property of the
    window
  2. Resolve the _NET_WM_STATE and _KDE_NET_WM_STATE_SKIP_SWITCHER atoms
    via xcb
  3. Read existing _NET_WM_STATE to avoid duplicating the atom, and check
    the append request for X11 errors
  4. Connect to QWindow::visibleChanged to restore the hint on each
    show, since KWin clears _NET_WM_STATE on withdrawal and Qt emits
    visibleChanged before mapping the window
  5. Call setSkipSwitcher() once at construction time so already-visible
    windows get the hint

This prevents the layer shell window from appearing in the task switcher
(Alt+Tab), keeping emulated layer-shell windows consistent with their
intended behavior.

Influence:

  1. Verify the layer shell window does not appear in the alt-tab switcher
  2. Check the window still maps and displays correctly after the hint
    is applied
  3. Test hide/show cycles and confirm the skip-switcher hint is restored
    each time
  4. Verify no errors or warnings are logged on non-X11 or early call
    paths
  5. Confirm the property atom is not duplicated when the window is shown
    repeatedly
  6. Test with multiple layer shell windows to ensure no interference

fix: 为 X11 layer shell 添加跳过切换器提示

  1. 新增 setSkipSwitcher() 辅助函数,向窗口的 _NET_WM_STATE 属性追加
    _KDE_NET_WM_STATE_SKIP_SWITCHER
  2. 通过 xcb 解析 _NET_WM_STATE 和 _KDE_NET_WM_STATE_SKIP_SWITCHER 原子
  3. 读取现有 _NET_WM_STATE 以避免重复添加该原子,并检查追加请求的 X11
    错误
  4. 连接 QWindow::visibleChanged,在每次显示时恢复该提示,因为 KWin 在窗
    口撤回时会清除 _NET_WM_STATE,而 Qt 在映射窗口前就会发出 visibleChanged
  5. 在构造时调用一次 setSkipSwitcher(),使已可见的窗口也能获得该提示

这样可以避免 layer shell 窗口出现在任务切换器(Alt+Tab)中,使模拟的
layer-shell 窗口行为保持一致。

Influence:

  1. 验证 layer shell 窗口不会出现在 alt-tab 切换器中
  2. 检查应用提示后窗口仍能正确映射和显示
  3. 测试隐藏/显示循环,确认每次都会恢复跳过切换器提示
  4. 验证在非 X11 或过早调用路径下不会记录错误或警告
  5. 确认窗口反复显示时该属性原子不会被重复添加
  6. 使用多个 layer shell 窗口测试,确保互不干扰

Log: Added skip-switcher hint for X11 layer shell windows to keep them
out of the task switcher
PMS: BUG-382313

Summary by Sourcery

Prevent emulated X11 layer-shell windows from appearing in the task switcher while preserving the hint across window visibility changes.

Bug Fixes:

  • Keep X11 layer-shell windows out of the task switcher by applying the KDE skip-switcher window state.

Enhancements:

  • Restore the skip-switcher state whenever the window is shown and avoid duplicating the state atom.

1. Add setSkipSwitcher() helper to append
_KDE_NET_WM_STATE_SKIP_SWITCHER to the _NET_WM_STATE property of the
window
2. Resolve the _NET_WM_STATE and _KDE_NET_WM_STATE_SKIP_SWITCHER atoms
via xcb
3. Read existing _NET_WM_STATE to avoid duplicating the atom, and check
the append request for X11 errors
4. Connect to QWindow::visibleChanged to restore the hint on each
show, since KWin clears _NET_WM_STATE on withdrawal and Qt emits
visibleChanged before mapping the window
5. Call setSkipSwitcher() once at construction time so already-visible
windows get the hint

This prevents the layer shell window from appearing in the task switcher
(Alt+Tab), keeping emulated layer-shell windows consistent with their
intended behavior.

Influence:
1. Verify the layer shell window does not appear in the alt-tab switcher
2. Check the window still maps and displays correctly after the hint
is applied
3. Test hide/show cycles and confirm the skip-switcher hint is restored
each time
4. Verify no errors or warnings are logged on non-X11 or early call
paths
5. Confirm the property atom is not duplicated when the window is shown
repeatedly
6. Test with multiple layer shell windows to ensure no interference

fix: 为 X11 layer shell 添加跳过切换器提示

1. 新增 setSkipSwitcher() 辅助函数,向窗口的 _NET_WM_STATE 属性追加
_KDE_NET_WM_STATE_SKIP_SWITCHER
2. 通过 xcb 解析 _NET_WM_STATE 和 _KDE_NET_WM_STATE_SKIP_SWITCHER 原子
3. 读取现有 _NET_WM_STATE 以避免重复添加该原子,并检查追加请求的 X11
错误
4. 连接 QWindow::visibleChanged,在每次显示时恢复该提示,因为 KWin 在窗
口撤回时会清除 _NET_WM_STATE,而 Qt 在映射窗口前就会发出 visibleChanged
5. 在构造时调用一次 setSkipSwitcher(),使已可见的窗口也能获得该提示

这样可以避免 layer shell 窗口出现在任务切换器(Alt+Tab)中,使模拟的
layer-shell 窗口行为保持一致。

Influence:
1. 验证 layer shell 窗口不会出现在 alt-tab 切换器中
2. 检查应用提示后窗口仍能正确映射和显示
3. 测试隐藏/显示循环,确认每次都会恢复跳过切换器提示
4. 验证在非 X11 或过早调用路径下不会记录错误或警告
5. 确认窗口反复显示时该属性原子不会被重复添加
6. 使用多个 layer shell 窗口测试,确保互不干扰

Log: Added skip-switcher hint for X11 layer shell windows to keep them
 out of the task switcher
PMS: BUG-382313
@18202781743
18202781743 requested review from BLumia and mhduiy November 19, 2026 05:12
@sourcery-ai

sourcery-ai Bot commented Nov 19, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Add the X11 helper that resolves the relevant atoms, avoids duplicate state entries, and checks the property update for errors.

  • frame/layershell/x11dlayershellemulation.cpp L26-74

Restore the skip-switcher hint on visibility changes and apply it immediately to windows already visible at construction.

  • frame/layershell/x11dlayershellemulation.cpp L128-133

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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@deepin-ci-robot

deepin-ci-robot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

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

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

@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 3 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="61-62" />
<code_context>
+    }
+    if (state->type == XCB_ATOM_ATOM && state->format == 32) {
+        const auto *atoms = static_cast<const xcb_atom_t *>(xcb_get_property_value(state.get()));
+        if (std::find(atoms, atoms + state->value_len, skipSwitcher->atom) != atoms + state->value_len) {
+            return;
+        }
+    }
</code_context>
<issue_to_address>
**Remapped windows reappear in task switcher**

When the window is hidden and shown again before KWin processes its withdrawal, `setSkipSwitcher` returns when `std::find` sees the old atom, then KWin processes the pending withdrawal and clears `_NET_WM_STATE`, leaving the remapped window in the task switcher until another show cycle.

Ensure the skip-switcher hint is reapplied after KWin processes the withdrawal instead of returning based on the stale atom.

Also at `frame/layershell/x11dlayershellemulation.cpp:130-131`.
</issue_to_address>

### Comment 2
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="66" />
<code_context>
+        }
+    }
+
+    const auto appendCookie = xcb_change_property_checked(connection, XCB_PROP_MODE_APPEND, windowId, wmState->atom, XCB_ATOM_ATOM, 32, 1, &skipSwitcher->atom);
+    const std::unique_ptr<xcb_generic_error_t, decltype(&std::free)> error(xcb_request_check(connection, appendCookie), &std::free);
+    if (error) {
</code_context>
<issue_to_address>
**Mapped windows remain switchable**

When `DLayerShellWindow` is attached after the X11 window has already been mapped, the helper changes `_NET_WM_STATE` directly without sending the EWMH state-change request; KWin can ignore or replace that client-side update, leaving the already-mapped window in Alt+Tab.

For mapped windows, request the state change with an EWMH `_NET_WM_STATE` ClientMessage; keep setting the initial property before mapping.
</issue_to_address>

### Comment 3
<location path="frame/layershell/x11dlayershellemulation.cpp" line_range="45-68" />
<code_context>
+    const std::unique_ptr<xcb_intern_atom_reply_t, decltype(&std::free)> wmState(xcb_intern_atom_reply(connection, wmStateCookie, nullptr), &std::free);
</code_context>
<issue_to_address>
**Slow X server delays window showing**

When the X server is slow or stops replying during a show, `xcb_intern_atom_reply`, `xcb_get_property_reply`, and `xcb_request_check` synchronously wait for the X server on the GUI thread each time the window is shown. On a slow or unresponsive X server, these round trips delay showing the window or leave the GUI blocked.

Avoid repeated synchronous X11 round trips on the GUI thread, for example by caching atoms and handling the property update asynchronously.
</issue_to_address>

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

Comment on lines +61 to +62
if (std::find(atoms, atoms + state->value_len, skipSwitcher->atom) != atoms + state->value_len) {
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Remapped windows reappear in task switcher

When the window is hidden and shown again before KWin processes its withdrawal, setSkipSwitcher returns when std::find sees the old atom, then KWin processes the pending withdrawal and clears _NET_WM_STATE, leaving the remapped window in the task switcher until another show cycle.

Ensure the skip-switcher hint is reapplied after KWin processes the withdrawal instead of returning based on the stale atom.

Also at frame/layershell/x11dlayershellemulation.cpp:130-131.

Prompt for AI agents
In `frame/layershell/x11dlayershellemulation.cpp` at lines 61-62:

**Remapped windows reappear in task switcher**

When the window is hidden and shown again before KWin processes its withdrawal, `setSkipSwitcher` returns when `std::find` sees the old atom, then KWin processes the pending withdrawal and clears `_NET_WM_STATE`, leaving the remapped window in the task switcher until another show cycle.

Ensure the skip-switcher hint is reapplied after KWin processes the withdrawal instead of returning based on the stale atom.

Also at `frame/layershell/x11dlayershellemulation.cpp:130-131`.

}
}

const auto appendCookie = xcb_change_property_checked(connection, XCB_PROP_MODE_APPEND, windowId, wmState->atom, XCB_ATOM_ATOM, 32, 1, &skipSwitcher->atom);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Mapped windows remain switchable

When DLayerShellWindow is attached after the X11 window has already been mapped, the helper changes _NET_WM_STATE directly without sending the EWMH state-change request; KWin can ignore or replace that client-side update, leaving the already-mapped window in Alt+Tab.

For mapped windows, request the state change with an EWMH _NET_WM_STATE ClientMessage; keep setting the initial property before mapping.

Prompt for AI agents
In `frame/layershell/x11dlayershellemulation.cpp` at line 66:

**Mapped windows remain switchable**

When `DLayerShellWindow` is attached after the X11 window has already been mapped, the helper changes `_NET_WM_STATE` directly without sending the EWMH state-change request; KWin can ignore or replace that client-side update, leaving the already-mapped window in Alt+Tab.

For mapped windows, request the state change with an EWMH `_NET_WM_STATE` ClientMessage; keep setting the initial property before mapping.

Comment on lines +45 to +68
const std::unique_ptr<xcb_intern_atom_reply_t, decltype(&std::free)> wmState(xcb_intern_atom_reply(connection, wmStateCookie, nullptr), &std::free);
const std::unique_ptr<xcb_intern_atom_reply_t, decltype(&std::free)> skipSwitcher(xcb_intern_atom_reply(connection, skipSwitcherCookie, nullptr),
&std::free);
if (!wmState || !skipSwitcher) {
qCWarning(layershell) << "Failed to resolve SkipSwitcher atoms for window" << windowId;
return;
}

const auto stateCookie = xcb_get_property(connection, false, windowId, wmState->atom, XCB_ATOM_ATOM, 0, 1024);
const std::unique_ptr<xcb_get_property_reply_t, decltype(&std::free)> state(xcb_get_property_reply(connection, stateCookie, nullptr), &std::free);
if (!state) {
qCWarning(layershell) << "Failed to read _NET_WM_STATE for window" << windowId;
return;
}
if (state->type == XCB_ATOM_ATOM && state->format == 32) {
const auto *atoms = static_cast<const xcb_atom_t *>(xcb_get_property_value(state.get()));
if (std::find(atoms, atoms + state->value_len, skipSwitcher->atom) != atoms + state->value_len) {
return;
}
}

const auto appendCookie = xcb_change_property_checked(connection, XCB_PROP_MODE_APPEND, windowId, wmState->atom, XCB_ATOM_ATOM, 32, 1, &skipSwitcher->atom);
const std::unique_ptr<xcb_generic_error_t, decltype(&std::free)> error(xcb_request_check(connection, appendCookie), &std::free);
if (error) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Slow X server delays window showing

When the X server is slow or stops replying during a show, xcb_intern_atom_reply, xcb_get_property_reply, and xcb_request_check synchronously wait for the X server on the GUI thread each time the window is shown. On a slow or unresponsive X server, these round trips delay showing the window or leave the GUI blocked.

Avoid repeated synchronous X11 round trips on the GUI thread, for example by caching atoms and handling the property update asynchronously.

Prompt for AI agents
In `frame/layershell/x11dlayershellemulation.cpp` at lines 45-68:

**Slow X server delays window showing**

When the X server is slow or stops replying during a show, `xcb_intern_atom_reply`, `xcb_get_property_reply`, and `xcb_request_check` synchronously wait for the X server on the GUI thread each time the window is shown. On a slow or unresponsive X server, these round trips delay showing the window or leave the GUI blocked.

Avoid repeated synchronous X11 round trips on the GUI thread, for example by caching atoms and handling the property update asynchronously.

@18202781743
18202781743 merged commit 8cf3d41 into linuxdeepin:master Nov 19, 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