mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 10:45:58 +01:00
swipe: add events
This commit is contained in:
parent
93915502d2
commit
d88d589880
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,8 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
|
||||||
static auto PSWIPEFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_fingers");
|
static auto PSWIPEFINGERS = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_fingers");
|
||||||
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
static auto PSWIPENEW = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_create_new");
|
||||||
|
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("swipeBegin", e);
|
||||||
|
|
||||||
if (e->fingers != *PSWIPEFINGERS || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked())
|
if (e->fingers != *PSWIPEFINGERS || *PSWIPE == 0 || g_pSessionLockManager->isSessionLocked())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -42,6 +44,8 @@ void CInputManager::beginWorkspaceSwipe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
|
void CInputManager::onSwipeEnd(wlr_pointer_swipe_end_event* e) {
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("swipeEnd", e);
|
||||||
|
|
||||||
if (!m_sActiveSwipe.pWorkspaceBegin)
|
if (!m_sActiveSwipe.pWorkspaceBegin)
|
||||||
return; // no valid swipe
|
return; // no valid swipe
|
||||||
endWorkspaceSwipe();
|
endWorkspaceSwipe();
|
||||||
|
@ -195,6 +199,8 @@ void CInputManager::endWorkspaceSwipe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("swipeUpdate", e);
|
||||||
|
|
||||||
if (!m_sActiveSwipe.pWorkspaceBegin)
|
if (!m_sActiveSwipe.pWorkspaceBegin)
|
||||||
return;
|
return;
|
||||||
static auto PSWIPEINVR = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_invert");
|
static auto PSWIPEINVR = CConfigValue<Hyprlang::INT>("gestures:workspace_swipe_invert");
|
||||||
|
|
Loading…
Reference in a new issue