diff --git a/src/Compositor.cpp b/src/Compositor.cpp index e70f2e32..8fcde961 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -174,6 +174,9 @@ void CCompositor::initAllSignals() { addWLSignal(&m_sWLRCursor->events.swipe_begin, &Events::listen_swipeBegin, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRCursor->events.swipe_update, &Events::listen_swipeUpdate, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRCursor->events.swipe_end, &Events::listen_swipeEnd, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.pinch_begin, &Events::listen_pinchBegin, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.pinch_update, &Events::listen_pinchUpdate, m_sWLRCursor, "WLRCursor"); + addWLSignal(&m_sWLRCursor->events.pinch_end, &Events::listen_pinchEnd, m_sWLRCursor, "WLRCursor"); addWLSignal(&m_sWLRBackend->events.new_input, &Events::listen_newInput, m_sWLRBackend, "Backend"); addWLSignal(&m_sSeat.seat->events.request_set_cursor, &Events::listen_requestMouse, &m_sSeat, "Seat"); addWLSignal(&m_sSeat.seat->events.request_set_selection, &Events::listen_requestSetSel, &m_sSeat, "Seat"); diff --git a/src/events/Devices.cpp b/src/events/Devices.cpp index 5660772c..53ac70dc 100644 --- a/src/events/Devices.cpp +++ b/src/events/Devices.cpp @@ -177,3 +177,18 @@ void Events::listener_swipeEnd(wl_listener* listener, void* data) { g_pInputManager->onSwipeEnd(EVENT); } + +void Events::listener_pinchBegin(wl_listener* listener, void* data) { + const auto EV = (wlr_pointer_pinch_begin_event*)data; + wlr_pointer_gestures_v1_send_pinch_begin(g_pCompositor->m_sWLRPointerGestures, g_pCompositor->m_sSeat.seat, EV->time_msec, EV->fingers); +} + +void Events::listener_pinchUpdate(wl_listener* listener, void* data) { + const auto EV = (wlr_pointer_pinch_update_event*)data; + wlr_pointer_gestures_v1_send_pinch_update(g_pCompositor->m_sWLRPointerGestures, g_pCompositor->m_sSeat.seat, EV->time_msec, EV->dx, EV->dy, EV->scale, EV->rotation); +} + +void Events::listener_pinchEnd(wl_listener* listener, void* data) { + const auto EV = (wlr_pointer_pinch_end_event*)data; + wlr_pointer_gestures_v1_send_pinch_end(g_pCompositor->m_sWLRPointerGestures, g_pCompositor->m_sSeat.seat, EV->time_msec, EV->cancelled); +} \ No newline at end of file diff --git a/src/events/Events.hpp b/src/events/Events.hpp index 320feaa4..ba8088a8 100644 --- a/src/events/Events.hpp +++ b/src/events/Events.hpp @@ -120,10 +120,14 @@ namespace Events { LISTENER(newIdleInhibitor); + // session + LISTENER(sessionActive); + + // Touchpad shit LISTENER(swipeBegin); LISTENER(swipeEnd); LISTENER(swipeUpdate); - - // session - LISTENER(sessionActive); + LISTENER(pinchBegin); + LISTENER(pinchUpdate); + LISTENER(pinchEnd); }; \ No newline at end of file