Move popup cleanup from Workspace::removeX11Window() to Workspace::removeAbstractClient()

This popup cleanup code can be useful also on wayland.
This commit is contained in:
Vlad Zahorodnii 2022-05-18 12:48:15 +03:00 committed by Xaver Hugl
parent 62e1130846
commit 06a9c686f1

View file

@ -724,13 +724,6 @@ void Workspace::addUnmanaged(Unmanaged *window)
*/
void Workspace::removeX11Window(X11Window *window)
{
if (window == m_activePopupWindow) {
closeActivePopup();
}
if (m_userActionsMenu->isMenuWindow(window)) {
m_userActionsMenu->close();
}
Q_ASSERT(m_x11Clients.contains(window));
// TODO: if marked window is removed, notify the marked list
m_x11Clients.removeAll(window);
@ -811,6 +804,13 @@ void Workspace::removeWaylandWindow(Window *window)
void Workspace::removeAbstractClient(Window *window)
{
if (window == m_activePopupWindow) {
closeActivePopup();
}
if (m_userActionsMenu->isMenuWindow(window)) {
m_userActionsMenu->close();
}
m_allClients.removeAll(window);
if (window == m_delayFocusWindow) {
cancelDelayFocus();