mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
Added drag to move window
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user