From f8def68e7e761e33dd51c197ac89194a51fcb60f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 13 Jul 2023 18:05:34 +0200 Subject: idle: implement new protocol --- src/managers/input/IdleInhibitor.cpp | 12 ++++++------ src/managers/input/InputManager.cpp | 8 ++++---- src/managers/input/Touch.cpp | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/managers') diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp index d54ec96a..d30cf9de 100644 --- a/src/managers/input/IdleInhibitor.cpp +++ b/src/managers/input/IdleInhibitor.cpp @@ -42,10 +42,10 @@ void CInputManager::recheckIdleInhibitorStatus() { for (auto& ii : m_lIdleInhibitors) { if (!ii.pWindow) { - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + g_pCompositor->setIdleActivityInhibit(false); return; } else if (g_pHyprRenderer->shouldRenderWindow(ii.pWindow)) { - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + g_pCompositor->setIdleActivityInhibit(false); return; } } @@ -56,21 +56,21 @@ void CInputManager::recheckIdleInhibitorStatus() { continue; if (w->m_eIdleInhibitMode == IDLEINHIBIT_ALWAYS) { - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + g_pCompositor->setIdleActivityInhibit(false); return; } if (w->m_eIdleInhibitMode == IDLEINHIBIT_FOCUS && g_pCompositor->isWindowActive(w.get())) { - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + g_pCompositor->setIdleActivityInhibit(false); return; } if (w->m_eIdleInhibitMode == IDLEINHIBIT_FULLSCREEN && w->m_bIsFullscreen && g_pCompositor->isWorkspaceVisible(w->m_iWorkspaceID)) { - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, false); + g_pCompositor->setIdleActivityInhibit(false); return; } } - wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, true); + g_pCompositor->setIdleActivityInhibit(true); return; } \ No newline at end of file diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index cf7dee6e..f423fd0d 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -320,7 +320,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { m_bEmptyFocusCursorSet = false; if (time) - wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + g_pCompositor->notifyIdleActivity(); Vector2D surfaceLocal = surfacePos == Vector2D(-1337, -1337) ? surfaceCoords : mouseCoords - surfacePos; @@ -432,7 +432,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { } void CInputManager::onMouseButton(wlr_pointer_button_event* e) { - wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + g_pCompositor->notifyIdleActivity(); EMIT_HOOK_EVENT("mouseButton", e); @@ -607,7 +607,7 @@ void CInputManager::onMouseWheel(wlr_pointer_axis_event* e) { bool passEvent = g_pKeybindManager->onAxisEvent(e); - wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + g_pCompositor->notifyIdleActivity(); if (passEvent) { wlr_seat_pointer_notify_axis(g_pCompositor->m_sSeat.seat, e->time_msec, e->orientation, factor * e->delta, std::round(factor * e->delta_discrete), e->source); @@ -1067,7 +1067,7 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar bool passEvent = g_pKeybindManager->onKeyEvent(e, pKeyboard); - wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + g_pCompositor->notifyIdleActivity(); if (passEvent) { diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp index 0826e384..19e29c1b 100644 --- a/src/managers/input/Touch.cpp +++ b/src/managers/input/Touch.cpp @@ -48,7 +48,7 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) { wlr_seat_touch_notify_down(g_pCompositor->m_sSeat.seat, m_sTouchData.touchFocusSurface, e->time_msec, e->touch_id, local.x, local.y); - wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + g_pCompositor->notifyIdleActivity(); } void CInputManager::onTouchUp(wlr_touch_up_event* e) { -- cgit v1.2.3