From 99ca1ad35398791a8dd534584d741ff2784bcd8d Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 17 Dec 2022 12:15:56 +0000 Subject: [PATCH] remember pos and size across fullscreen moves --- src/managers/KeybindManager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index a2de8162..f41f47bf 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -431,8 +431,8 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) { const unsigned int TTY = keysym - XKB_KEY_XF86Switch_VT_1 + 1; // vtnr is bugged for some reason. - const std::string TTYSTR = execAndGet("head -n 1 /sys/devices/virtual/tty/tty0/active").substr(3); - unsigned int ttynum = 0; + const std::string TTYSTR = execAndGet("head -n 1 /sys/devices/virtual/tty/tty0/active").substr(3); + unsigned int ttynum = 0; try { ttynum = std::stoll(TTYSTR); } catch (std::exception& e) { @@ -633,9 +633,9 @@ void CKeybindManager::changeworkspace(std::string args) { // Flag needed so that the previous workspace is not recorded when switching // to a previous workspace. - bool isSwitchingToPrevious = false; + bool isSwitchingToPrevious = false; - bool internal = false; + bool internal = false; if (args.find("[internal]") == 0) { workspaceToChangeTo = std::stoi(args.substr(10)); @@ -881,7 +881,7 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) { if (!PWINDOW) return; - const auto OLDWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID); + const auto OLDWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID); // hack std::string workspaceName; @@ -897,8 +897,8 @@ void CKeybindManager::moveActiveToWorkspace(std::string args) { return; } - auto PSAVEDSIZE = PWINDOW->m_vRealSize.goalv(); - auto PSAVEDPOS = PWINDOW->m_vRealPosition.goalv(); + auto PSAVEDSIZE = PWINDOW->m_bIsFloating && PWINDOW->m_bIsFullscreen ? PWINDOW->m_vLastFloatingSize : PWINDOW->m_vRealSize.goalv(); + auto PSAVEDPOS = PWINDOW->m_bIsFloating && PWINDOW->m_bIsFullscreen ? PWINDOW->m_vLastFloatingPosition : PWINDOW->m_vRealPosition.goalv(); const bool WASFULLSCREEN = PWINDOW->m_bIsFullscreen; g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);