summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorMihai Fufezan <fufexan@protonmail.com>2022-08-09 11:57:09 +0300
committerMihai Fufezan <fufexan@protonmail.com>2022-08-09 11:57:09 +0300
commitf28b71232a97d9d94e9b276b1c7de4c7a89b933d (patch)
treee0d3286e5d331b98c2e679d73a98f6580c6a8efa /src/managers/KeybindManager.cpp
parentaf9d34ab774f69f31cbd68096b4f376e2270caad (diff)
unhide window on requested size change
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 987e4309..31a1045a 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1147,6 +1147,12 @@ void CKeybindManager::resizeActive(std::string args) {
if (!args.contains(' '))
return;
+ const auto PWINDOW = g_pCompositor->m_pLastWindow;
+
+ // calc the delta
+ if (!g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow))
+ return; // ignore
+
std::string x = args.substr(0, args.find_first_of(' '));
std::string y = args.substr(args.find_first_of(' ') + 1);
@@ -1167,17 +1173,14 @@ void CKeybindManager::resizeActive(std::string args) {
return;
}
- // calc the delta
- if (!g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow))
- return; // ignore
-
- const auto PWINDOW = g_pCompositor->m_pLastWindow;
-
const int DX = X - PWINDOW->m_vRealSize.goalv().x;
const int DY = Y - PWINDOW->m_vRealSize.goalv().y;
g_pLayoutManager->getCurrentLayout()->resizeActiveWindow(Vector2D(DX, DY));
+ if (PWINDOW->m_vRealSize.goalv().x > 1 && PWINDOW->m_vRealSize.goalv().y > 1)
+ PWINDOW->m_bHidden = false;
+
return;
}
@@ -1190,6 +1193,9 @@ void CKeybindManager::resizeActive(std::string args) {
const int Y = std::stoi(y);
g_pLayoutManager->getCurrentLayout()->resizeActiveWindow(Vector2D(X, Y));
+
+ if (PWINDOW->m_vRealSize.goalv().x > 1 && PWINDOW->m_vRealSize.goalv().y > 1)
+ PWINDOW->m_bHidden = false;
}
void CKeybindManager::moveActive(std::string args) {