fix moved windows losing props

This commit is contained in:
vaxerski 2022-01-01 01:21:28 +01:00
parent 41f5d56c4e
commit 7a4b5b2dea

View file

@ -1359,9 +1359,10 @@ void CWindowManager::moveActiveWindowToWorkspace(int workspace) {
const auto SAVEDFLOATSTATUS = PWINDOW->getIsFloating(); const auto SAVEDFLOATSTATUS = PWINDOW->getIsFloating();
const auto SAVEDDRAWABLE = PWINDOW->getDrawable(); const auto SAVEDDRAWABLE = PWINDOW->getDrawable();
closeWindowAllChecks(SAVEDDRAWABLE); fixWindowOnClose(PWINDOW);
// PWINDOW is dead! if (const auto WORKSPACE = getWorkspaceByID(PWINDOW->getWorkspaceID()); WORKSPACE && PWINDOW->getFullscreen())
WORKSPACE->setHasFullscreenWindow(false);
changeWorkspaceByID(workspace); changeWorkspaceByID(workspace);
@ -1386,19 +1387,12 @@ void CWindowManager::moveActiveWindowToWorkspace(int workspace) {
setFocusedWindow(newLastWindow); setFocusedWindow(newLastWindow);
} }
CWindow newWindow;
newWindow.setDrawable(SAVEDDRAWABLE);
newWindow.setFirstOpen(false);
addWindowToVectorSafe(newWindow);
CWindow* PNEWWINDOW = nullptr;
if (SAVEDFLOATSTATUS) if (SAVEDFLOATSTATUS)
PNEWWINDOW = Events::remapFloatingWindow(SAVEDDRAWABLE, NEWMONITOR); Events::remapFloatingWindow(PWINDOW->getDrawable(), NEWMONITOR);
else else
PNEWWINDOW = Events::remapWindow(SAVEDDRAWABLE, false, NEWMONITOR); Events::remapWindow(PWINDOW->getDrawable(), false, NEWMONITOR);
PWINDOW->setDefaultSize(SAVEDDEFAULTSIZE);
PNEWWINDOW->setDefaultSize(SAVEDDEFAULTSIZE);
} }
void CWindowManager::moveActiveWindowTo(char dir) { void CWindowManager::moveActiveWindowTo(char dir) {