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(); Q_EMIT closed();
setTile(nullptr);
workspace()->removeInternalWindow(this); workspace()->removeInternalWindow(this);
m_handle = nullptr; m_handle = nullptr;

View file

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

View file

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

View file

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