Skip to content

Add KStatusNotifierItem::hideAssociatedWidget()

Use case: hiding a single instance window of util program in case of click of the window close button, and enabling the systray entry to restore the window with proper info about "Show-on-all-virtual-desktops".

Currently if the app just hides the window itself, such information is lost. Trying to use the KStatusNotifierItem::activate() instead and before checking all possible states where this method would actually hide the window is error prone, as the actual behaviour is not defined and one easily misses a case (like that for xcb there is a code path which checks if the window is the covered by others, and actually raises it of not, which was missed and now triggers in Konversation 21.12.1 when trying to close a window that is not the top-most).

Would be used here (and in similar code in other single instance apps): https://invent.kde.org/network/konversation/-/blob/master/src/viewer/trayicon.cpp#L35

@broulik @apol

Merge request reports