summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorMightyPlaza <123664421+MightyPlaza@users.noreply.github.com>2024-02-04 15:40:20 +0000
committerGitHub <noreply@github.com>2024-02-04 15:40:20 +0000
commitcbadf3e3f31ab5ad5d192daac5f2ca930d08b8fb (patch)
tree40fe310e5ffb955a19b32a2c8d234b3bdf9e45cb /src/managers/KeybindManager.cpp
parent1ed4f1cb254ce4b4e55727d972998be1ef4baf22 (diff)
input: focus window on mouse down on decoration (#4514)
Also unifies vectorToWindow funcs
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index eae86d39..7f6c06ae 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -1067,7 +1067,7 @@ void CKeybindManager::moveActiveToWorkspaceSilent(std::string args) {
}
if (PWINDOW == g_pCompositor->m_pLastWindow) {
- if (const auto PATCOORDS = g_pCompositor->vectorToWindowIdeal(OLDMIDDLE, PWINDOW); PATCOORDS)
+ if (const auto PATCOORDS = g_pCompositor->vectorToWindowUnified(OLDMIDDLE, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING, PWINDOW); PATCOORDS)
g_pCompositor->focusWindow(PATCOORDS);
else
g_pInputManager->refocus();
@@ -1939,7 +1939,7 @@ void CKeybindManager::pinActive(std::string args) {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
- PWORKSPACE->m_pLastFocusedWindow = g_pCompositor->vectorToWindowTiled(g_pInputManager->getMouseCoordsInternal());
+ PWORKSPACE->m_pLastFocusedWindow = g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS);
}
void CKeybindManager::mouse(std::string args) {
@@ -1951,7 +1951,7 @@ void CKeybindManager::mouse(std::string args) {
g_pKeybindManager->m_bIsMouseBindActive = true;
const auto mouseCoords = g_pInputManager->getMouseCoordsInternal();
- CWindow* pWindow = g_pCompositor->vectorToWindowIdeal(mouseCoords);
+ CWindow* pWindow = g_pCompositor->vectorToWindowUnified(mouseCoords, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
if (pWindow && !pWindow->m_bIsFullscreen)
pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_START, mouseCoords);
@@ -1974,7 +1974,8 @@ void CKeybindManager::mouse(std::string args) {
if (PRESSED) {
g_pKeybindManager->m_bIsMouseBindActive = true;
- g_pInputManager->currentlyDraggedWindow = g_pCompositor->vectorToWindowIdeal(g_pInputManager->getMouseCoordsInternal());
+ g_pInputManager->currentlyDraggedWindow =
+ g_pCompositor->vectorToWindowUnified(g_pInputManager->getMouseCoordsInternal(), RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
try {
switch (std::stoi(ARGS[1])) {