mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 01:46:00 +01:00
pluginapi: add touch event hooks (#3836)
This commit is contained in:
parent
016a7a9c9b
commit
4d6fa6ed0c
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
||||||
#include "../../Compositor.hpp"
|
#include "../../Compositor.hpp"
|
||||||
|
|
||||||
void CInputManager::onTouchDown(wlr_touch_down_event* e) {
|
void CInputManager::onTouchDown(wlr_touch_down_event* e) {
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("touchDown", e);
|
||||||
|
|
||||||
auto PMONITOR = g_pCompositor->getMonitorFromName(e->touch->output_name ? e->touch->output_name : "");
|
auto PMONITOR = g_pCompositor->getMonitorFromName(e->touch->output_name ? e->touch->output_name : "");
|
||||||
|
|
||||||
const auto PDEVIT = std::find_if(m_lTouchDevices.begin(), m_lTouchDevices.end(), [&](const STouchDevice& other) { return other.pWlrDevice == &e->touch->base; });
|
const auto PDEVIT = std::find_if(m_lTouchDevices.begin(), m_lTouchDevices.end(), [&](const STouchDevice& other) { return other.pWlrDevice == &e->touch->base; });
|
||||||
|
@ -52,12 +54,14 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::onTouchUp(wlr_touch_up_event* e) {
|
void CInputManager::onTouchUp(wlr_touch_up_event* e) {
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("touchUp", e);
|
||||||
if (m_sTouchData.touchFocusSurface) {
|
if (m_sTouchData.touchFocusSurface) {
|
||||||
wlr_seat_touch_notify_up(g_pCompositor->m_sSeat.seat, e->time_msec, e->touch_id);
|
wlr_seat_touch_notify_up(g_pCompositor->m_sSeat.seat, e->time_msec, e->touch_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::onTouchMove(wlr_touch_motion_event* e) {
|
void CInputManager::onTouchMove(wlr_touch_motion_event* e) {
|
||||||
|
EMIT_HOOK_EVENT_CANCELLABLE("touchMove", e);
|
||||||
if (m_sTouchData.touchFocusWindow && g_pCompositor->windowValidMapped(m_sTouchData.touchFocusWindow)) {
|
if (m_sTouchData.touchFocusWindow && g_pCompositor->windowValidMapped(m_sTouchData.touchFocusWindow)) {
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_sTouchData.touchFocusWindow->m_iMonitorID);
|
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_sTouchData.touchFocusWindow->m_iMonitorID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue