Bug 525792 - Panel edit mode: the panel toolbar closes when dragging a widget if a non-focusable "desktop" layer-shell window exists (e.g. conky)
Summary: Panel edit mode: the panel toolbar closes when dragging a widget if a non-foc...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: 6.6.6
Platform: TuxedoOS Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-09-15 18:36 UTC by rcspam
Modified: 2026-09-18 12:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.9.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rcspam 2026-09-15 18:36:36 UTC
With conky running on Wayland (`out_to_wayland = true`,
`own_window_namespace = 'desktop'`), moving a widget inside a panel in edit
mode fails: as soon as the drag starts, the panel configuration toolbar closes.
Dragging works if you start moving before the small widget popup (title plus
configure/remove buttons) has appeared. Without conky everything works.

What happens, from KWin's `windowActivated` signal and the 6.6 sources:

1. Since 6.6.5 (plasma-desktop, "Actually start the drag only after a pointer
   move"), the popup shown when hovering a panel widget in edit mode calls
   `requestActivate()`, so it owns keyboard focus. It hides when the drag starts.
2. KWin then runs `Workspace::activateNextWindow()`. The window under the mouse
   is the panel, which does not accept focus, so it falls back to
   `findDesktop()`, which returns the topmost desktop-type window in the
   stacking order. A layer-shell surface with scope "desktop" is a desktop-type
   window (`scopeToType` in layershellv1window.cpp); conky's one is above
   plasmashell's and refuses focus (`wantsInput() == false`). `requestFocus()`
   fails and KWin calls `resetFocus()`: no active window at all.
3. plasmashell receives a null focus window. `PanelConfigView::focusVisibilityCheck()`
   hides the toolbar on `!focusWindow` before it checks `m_panelView->mouseGrabberItem()`,
   which is set since the drag is in progress.

Two possible fixes, either is enough:

- KWin: `findDesktop()` (or `activateNextWindow()`) should skip desktop-type
  windows that do not want input, and keep looking for one that does.
- plasma-workspace: in `focusVisibilityCheck()`, test `mouseGrabberItem()` before
  the null focus window case, so an active drag never closes the toolbar.

STEP TO REPRODUCE

1. Plasma 6.6.6 Wayland. Start conky with `out_to_wayland = true` and
   `own_window_namespace = 'desktop'` (any layer-shell "desktop" surface that
   does not accept keyboard focus should do).
2. Right-click a panel, "Enter edit mode" (toolbar shown).
3. Hover a widget until its popup appears, then press and drag it.

Observed: the toolbar closes, the widget is not moved.
Expected: the widget moves, the toolbar stays.

Confirmation: with any other layer-shell namespace for conky (so it is no longer
a desktop-type window) the problem disappears. This is not a conky bug, though:
any client placing a "desktop" layer-shell surface that does not take keyboard
focus (conky, animated wallpaper tools, widgets drawn on the background) makes
KWin end up with no active window whenever the focused window goes away, and
anything that reacts to a null focus window, the panel toolbar here, breaks.
Comment 1 Bug Janitor Service 2026-09-17 11:07:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/9953
Comment 2 Vlad Zahorodnii 2026-09-17 11:19:26 UTC
Windows with the desktop namespace are reserved for desktop wallpapers. Using that namespace for conky is very very wrong.
Comment 3 Vlad Zahorodnii 2026-09-17 15:14:37 UTC
Git commit c995591e30393a289b2275adc173b9c820789874 by Vlad Zahorodnii, on behalf of 力文 胡.
Committed on 17/09/2026 at 14:51.
Pushed by vladz into branch 'master'.

core: Ignore non-focusable desktop windows in findDesktop()

A layer-shell surface with the "desktop" scope can refuse keyboard focus
by setting its keyboard_interactivity to none. Such a window can still
be stacked above the desktop window of plasmashell, and in that case
findDesktop() returned it.

Its result is passed to requestFocus(), which refuses to focus windows
that do not want input. activateNextWindow() therefore fell through to
resetFocus() and left the session without any active window.
plasmashell hides the panel toolbar when the focus window is null, which
is why the toolbar disappeared as soon as a widget was dragged in panel
edit mode.

Skip desktop windows that do not want input while looking for the next
window to activate. All callers of findDesktop() pass the result to
requestFocus(), so returning a window that cannot take focus is of no
use to any of them. Filtering in activateNextWindow() alone would leave
the same dead end in switchToOutput(), activateWindowOnDesktop() and
setShowingDesktop().

M  +1    -1    src/layers.cpp

https://invent.kde.org/plasma/kwin/-/commit/c995591e30393a289b2275adc173b9c820789874