https://bugs.kde.org/show_bug.cgi?id=524544

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #18 from [email protected] ---
# Bug 524544 — root cause identified live: leaked interactive
xwaylandvideobridge mirror window

I hit this on Bazzite and was able to instrument the broken state live. The
symptom matches exactly
(desktop icons unclickable, windows/taskbar/kickoff fine, "Peek at Desktop"
restores interaction), but
the root cause I found points at **xwaylandvideobridge / KWin window-state
handling** rather than the
Folder View containment itself. Filing here since the stack and symptom match;
maintainers feel free
to reassign.

## Environment

- Bazzite 44.20260825 (Fedora 44, Wayland)
- kwin 6.7.4-2, plasma-workspace 6.7.4-1, plasma-desktop 6.7.4-1,
xwaylandvideobridge 0.5.1-1, Qt 6.11.1
- NVIDIA RTX 5070, driver 610.57.04, NVIDIA open kernel module
- 2 outputs: DP-2 [email protected] (0,0), DP-3 [email protected] (104,1152)
- Desktop containment: Folder View (org.kde.plasma.folder)

## Symptom

- After interactively resizing/moving (non-fullscreen) windows, desktop icons
become unclickable;
  right-click context menu on the desktop does not appear. Windows, panel,
taskbar, kickoff all keep
  working. Toggling Peek at Desktop (workspace showingDesktop) restores desktop
interaction until the
  next occurrence. Affected monitor: the one covered by the mirror window (see
below).

## Root-cause evidence (captured live while broken)

1. KWin's interactive picker resolves a click on the dead desktop to the
videobridge mirror window,
   not the desktop view:

   $ qdbus org.kde.KWin /KWin org.kde.KWin.queryWindowInfo
   caption: Wayland to X Recording bridge — Xwayland Video Bridge
   desktopFile: org.kde.xwaylandvideobridge
   resourceClass: xwaylandvideobridge
   pid: 29683          (the bridge process)
   x/y/width/height: 104 / 1152 / 2560 / 1394   <- exactly DP-3 minus the 46px
panel
   layer: 2                                     <- desktop layer (above
desktop, below normal windows)
   type: 0 (Normal), fullscreen: false, minimized: false
   skipPager/skipSwitcher/skipTaskbar: true

   So every click on that desktop region is consumed by the bridge window;
plasmashell never sees it.
   This also explains why Peek at Desktop "fixes" it: showingDesktop hides
normal-type windows,
   including this one.

2. The mirror window lost its input-transparency and stacking contract.
   xwaylandvideobridge v0.5.1 src/contentswindow.cpp sets, at creation:

   setFlag(Qt::WindowDoesNotAcceptFocus);
   setFlag(Qt::WindowTransparentForInput);   // on X11 => empty XShape input
region
   KX11Extras::setState(winId(), NET::KeepBelow | NET::FullScreen |
                                NET::SkipTaskbar | NET::SkipPager |
NET::SkipSwitcher);

   The live window violated all of it:

   $ xwininfo -shape -id 0x1200008
     Class: InputOutput, Map State: IsViewable
     No window shape defined          <- expected: empty input region
(click-through)

   $ xprop -id 0x1200008 _NET_WM_STATE
   _NET_WM_STATE = _NET_WM_STATE_MAXIMIZED_VERT, _NET_WM_STATE_MAXIMIZED_HORZ,
                   _NET_WM_STATE_SKIP_TASKBAR, _NET_WM_STATE_SKIP_PAGER,
                   _KDE_NET_WM_STATE_SKIP_SWITCHER
   (KeepBelow and FullScreen are gone; KWin instead reports it maximized)

   Geometry was 2560x1394+104+1152 — maximized on DP-3 only — while the
constructor sizes the mirror
   to the united geometry of all screens. So this window was re-created or
re-geometried after
   creation and came back as a normal, maximized, interactive window.

3. KWin 6.7.4 has no name-based special-casing of videobridge windows
   (no "videobridge" match in v6.7.4 x11window.cpp / workspace.cpp), so
click-through depends
   entirely on the bridge setting the empty XShape input region. With the shape
gone, KWin correctly
   routes clicks to the topmost window: the mirror.

## Reproduction hypothesis

1. An X11 client screen-shares via the ScreenCast portal; xwaylandvideobridge
creates the mirror
   window (invisible, input-transparent, keep-below, "fullscreen").
2. During the share, windows are interactively moved/resized; the bridge
re-fits/re-creates the
   mirror to track content. In that path the mirror loses
WindowTransparentForInput / KeepBelow /
   FullScreen and ends up maximized and interactive.
3. The sharing client exits without the stream being torn down cleanly; the
stale, now-interactive
   mirror leaks and sits over the desktop. Breakage persists across peek
toggles (until killed).

Consistent with the trigger: it only breaks after interactive move/resize of
non-fullscreen windows
during/after a share, and one early commenter's observation that Peek works
"until an application
window is opened" (peek-off re-maps the zombie).

## Workarounds

- Immediate: `killall xwaylandvideobridge` (or toggle Peek at Desktop for a
temporary fix).
- Preventive: mask the autostart — `systemctl --user mask
[email protected]`
  (costs X11-native apps their screen sharing; portal-based sharing is
unaffected).

## What would help debugging

- Input-region handling for XShape (does KWin honor a *late* input-region
change / ShapeNotify for
  unmapped-then-remapped X windows?), and whether anything in the move/resize
path strips client
  XShape or fullscreen/keep-below state for skip_* X11 windows.
- Stale mirror lifecycle: the window outlived its PipeWire stream; the bridge
never closed it.

Happy to provide more state dumps on request.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to