Added drag to move window

This commit is contained in:
vaxerski
2022-04-03 13:49:21 +02:00
parent df6a3c6877
commit 462781b16f
5 changed files with 27 additions and 3 deletions

View File

@@ -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;
}