diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-09-19 19:04:48 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-09-19 19:04:48 +0100 |
| commit | c24b45671abe1f768e9b5e0a35930ad76e2d8bcc (patch) | |
| tree | 24ac1b68bb8fc8c7cc37fb45aa17551270183026 /src/managers/input | |
| parent | 85c7aaf15529dbff5af3460c099bcba2742b7652 (diff) | |
mouse binds overhaul
Diffstat (limited to 'src/managers/input')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 15 | ||||
| -rw-r--r-- | src/managers/input/InputManager.hpp | 8 |
2 files changed, 7 insertions, 16 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 21e6b56d..2b099ac3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -385,7 +385,6 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { // notify the keybind manager static auto *const PPASSMOUSE = &g_pConfigManager->getConfigValuePtr("binds:pass_mouse_when_bound")->intValue; - static auto *const PMAINMODINTERNAL = &g_pConfigManager->getConfigValuePtr("general:main_mod_internal")->intValue; const auto PASS = g_pKeybindManager->onMouseEvent(e); if (!PASS && !*PPASSMOUSE) @@ -400,22 +399,8 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { if (g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && g_pCompositor->m_pLastWindow->m_bIsFloating) g_pCompositor->moveWindowToTop(g_pCompositor->m_pLastWindow); - if ((e->button == BTN_LEFT || e->button == BTN_RIGHT) && wlr_keyboard_get_modifiers(PKEYBOARD) == (uint32_t)*PMAINMODINTERNAL) { - currentlyDraggedWindow = g_pCompositor->windowFromCursor(); - dragButton = e->button; - - g_pLayoutManager->getCurrentLayout()->onBeginDragWindow(); - - return; - } break; case WLR_BUTTON_RELEASED: - if (currentlyDraggedWindow) { - g_pLayoutManager->getCurrentLayout()->onEndDragWindow(); - currentlyDraggedWindow = nullptr; - dragButton = -1; - } - break; } diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index 82d047f3..9069e131 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -12,6 +12,12 @@ enum eClickBehaviorMode { CLICKMODE_KILL }; +enum eMouseBindMode { + MBIND_INVALID = -1, + MBIND_MOVE = 0, + MBIND_RESIZE +}; + struct STouchData { CWindow* touchFocusWindow = nullptr; Vector2D touchSurfaceOrigin; @@ -59,7 +65,7 @@ public: // for dragging floating windows CWindow* currentlyDraggedWindow = nullptr; - int dragButton = -1; + eMouseBindMode dragMode = MBIND_INVALID; SDrag m_sDrag; |
