tiles: Evacuate windows in CustomTile::remove()
This commit is contained in:
parent
ea9691a2f5
commit
9d3e87bd9d
2 changed files with 7 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "customtile.h"
|
||||
#include "core/output.h"
|
||||
#include "tilemanager.h"
|
||||
#include "window.h"
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
@ -273,6 +274,7 @@ void CustomTile::remove()
|
|||
|
||||
manager()->model()->beginRemoveTile(this);
|
||||
parentT->removeChild(this);
|
||||
m_parentTile = nullptr;
|
||||
manager()->model()->endRemoveTile();
|
||||
manager()->tileRemoved(this);
|
||||
|
||||
|
@ -320,6 +322,11 @@ void CustomTile::remove()
|
|||
}
|
||||
}
|
||||
|
||||
const auto windows = std::exchange(m_windows, {});
|
||||
for (Window *window : windows) {
|
||||
window->setTile(m_tiling->bestTileForPosition(window->moveResizeGeometry().center()));
|
||||
}
|
||||
|
||||
deleteLater(); // not using "delete this" because QQmlEngine will crash
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,6 @@ protected:
|
|||
void insertChild(int position, Tile *item);
|
||||
void removeChild(Tile *child);
|
||||
|
||||
private:
|
||||
QList<Tile *> m_children;
|
||||
QList<Window *> m_windows;
|
||||
Tile *m_parentTile;
|
||||
|
|
Loading…
Reference in a new issue