Unset Window::tile() when the window is closed

If a window is closed, its geometry should not change. The window has to
leave its assigned tile so it's not possibly moved or resized.
This commit is contained in:
Vlad Zahorodnii 2024-04-02 11:40:56 +03:00
parent 5272c24301
commit 28d6b5230a
4 changed files with 6 additions and 3 deletions

View file

@ -335,6 +335,7 @@ void InternalWindow::destroyWindow()
Q_EMIT closed();
setTile(nullptr);
workspace()->removeInternalWindow(this);
m_handle = nullptr;

View file

@ -101,9 +101,7 @@ Window::Window()
Window::~Window()
{
if (m_tile) {
m_tile->removeWindow(this);
}
Q_ASSERT(!m_tile);
Q_ASSERT(m_blockGeometryUpdates == 0);
}
@ -3611,6 +3609,7 @@ void Window::setTile(Tile *tile)
m_tile = tile;
if (m_tile) {
Q_ASSERT(!isDeleted());
m_tile->addWindow(this);
}

View file

@ -407,6 +407,7 @@ void X11Window::releaseWindow(bool on_shutdown)
if (isInteractiveMoveResize()) {
Q_EMIT interactiveMoveResizeFinished();
}
setTile(nullptr);
workspace()->rulebook()->discardUsed(this, true); // Remove ForceTemporarily rules
StackingUpdatesBlocker blocker(workspace());
stopDelayedInteractiveMoveResize();
@ -485,6 +486,7 @@ void X11Window::destroyWindow()
if (isInteractiveMoveResize()) {
Q_EMIT interactiveMoveResizeFinished();
}
setTile(nullptr);
workspace()->rulebook()->discardUsed(this, true); // Remove ForceTemporarily rules
StackingUpdatesBlocker blocker(workspace());
stopDelayedInteractiveMoveResize();

View file

@ -300,6 +300,7 @@ void XdgSurfaceWindow::destroyWindow()
leaveInteractiveMoveResize();
Q_EMIT interactiveMoveResizeFinished();
}
setTile(nullptr);
m_configureTimer->stop();
qDeleteAll(m_configureEvents);
m_configureEvents.clear();