Added drag to move window
This commit is contained in:
parent
df6a3c6877
commit
462781b16f
5 changed files with 27 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue