summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-12-17 12:15:56 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-12-17 12:15:56 +0000
commit99ca1ad35398791a8dd534584d741ff2784bcd8d (patch)
tree1e5a42971e3a25569284d18d4503ef61758124c6 /src/managers/KeybindManager.cpp
parent2076905d6efe05cc0f79995d73a18c3b8661ce21 (diff)
remember pos and size across fullscreen moves
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp14
1 files 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);