summaryrefslogtreecommitdiff
path: root/src/managers/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-03 13:49:21 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-03 13:49:21 +0200
commit462781b16f9763cbfd8f182b8680b00c823ecd9e (patch)
treece59ee859c62eaca851d82d5aed5f69a1aa83409 /src/managers/InputManager.cpp
parentdf6a3c687702e1d66215ff77aa97a003897f4140 (diff)
Added drag to move window
Diffstat (limited to 'src/managers/InputManager.cpp')
-rw-r--r--src/managers/InputManager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp
index 2483832a..e8cb19b9 100644
--- a/src/managers/InputManager.cpp
+++ b/src/managers/InputManager.cpp
@@ -122,7 +122,7 @@ void CInputManager::onMouseButton(wlr_pointer_button_event* e) {
refocus();
if ((e->button == BTN_LEFT || e->button == BTN_RIGHT) && wlr_keyboard_get_modifiers(PKEYBOARD) == (uint32_t)g_pConfigManager->getInt("general:main_mod_internal")) {
- currentlyDraggedWindow = g_pCompositor->windowFloatingFromCursor();
+ currentlyDraggedWindow = g_pCompositor->windowFromCursor();
dragButton = e->button;
g_pLayoutManager->getCurrentLayout()->onBeginDragWindow();
@@ -131,8 +131,12 @@ void CInputManager::onMouseButton(wlr_pointer_button_event* e) {
}
break;
case WLR_BUTTON_RELEASED:
- currentlyDraggedWindow = nullptr;
- dragButton = -1;
+ if (currentlyDraggedWindow) {
+ g_pLayoutManager->getCurrentLayout()->onEndDragWindow();
+ currentlyDraggedWindow = nullptr;
+ dragButton = -1;
+ }
+
break;
}