diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 11:14:24 +0100 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-03-20 11:14:24 +0100 |
| commit | a4b026df2b7f94b2985d38b1ef6fb127782c1a27 (patch) | |
| tree | c85f054baed6951fa096a358096fecc4e5c08a19 /src/managers/InputManager.cpp | |
| parent | a4d69a15b34e54d8438a7242b151b1d31cbef46a (diff) | |
floating windows support
Diffstat (limited to 'src/managers/InputManager.cpp')
| -rw-r--r-- | src/managers/InputManager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index ecf63bf2..cc7d302c 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -41,6 +41,7 @@ void CInputManager::mouseMoveUnified(uint32_t time) { wlr_seat_pointer_notify_motion(g_pCompositor->m_sWLRSeat, time, surfaceLocal.x, surfaceLocal.y); g_pCompositor->m_pLastMonitor = g_pCompositor->getMonitorFromCursor(); + g_pLayoutManager->getCurrentLayout()->onMouseMove(getMouseCoordsInternal()); } void CInputManager::onMouseButton(wlr_event_pointer_button* e) { @@ -48,10 +49,16 @@ void CInputManager::onMouseButton(wlr_event_pointer_button* e) { switch (e->state) { case WLR_BUTTON_PRESSED: - // todo: keybinds + if (e->button == BTN_LEFT || e->button == BTN_RIGHT) { + currentlyDraggedWindow = g_pCompositor->windowFloatingFromCursor(); + dragButton = e->button; + + g_pLayoutManager->getCurrentLayout()->onBeginDragWindow(); + } break; case WLR_BUTTON_RELEASED: - // todo: keybinds + currentlyDraggedWindow = nullptr; + dragButton = -1; break; } |
