Bug 488616

Summary: It should not be possible to close a non-closable floating QDockWidget with keyboard shortcuts
Product: [Plasma] kwin Reporter: Tobias Leupold <tl>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: tl, xaver.hugl
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tobias Leupold 2024-06-17 10:18:27 UTC
Hi all :-)

This surfaced in Bug #488597.

The problem is that a QDockWidget that is declared as non-closable but as floatable cannot be closed by clicking an "X" button (it's omitted then), but one can actually close such a floating dock nevertheless by using a keyboard shortcut (Alt+F4).

After that, there's no way to re-show that closed dock, as the menu bar's context menu containing checkboxes for all dock widgets is grayed out (it becomes enabled when adding docks with the "QDockWidget::DockWidgetClosable" feature set). The only way to get the dock back is to delete the window state from the rc file (in case of KGeoTag, as the default dock arrangement will be restored then).

My understanding is that a QDockWidget that is marked as not closable should not only not be closable by omitting the "X"/"Close" button, but also an attempt to close it using keyboard shortcuts should be ignored, to also prevent it from closing this way.

Cheers, Tobias
Comment 1 Zamundaaa 2024-06-17 11:31:15 UTC
Please report this to Qt, it's up to it to ignore the close request if it's inappropriate for the window
Comment 2 Tobias Leupold 2024-06-17 12:48:16 UTC
Sorry, I thought this was a window manager issue. Reported as https://bugreports.qt.io/browse/QTBUG-126418