diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-07-13 18:05:34 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-07-13 18:05:34 +0200 |
| commit | f8def68e7e761e33dd51c197ac89194a51fcb60f (patch) | |
| tree | 1d12af5dd8df5f7e9897237d9b902804eade1281 /src/Compositor.cpp | |
| parent | 9f7382bca4ddc6617b0524645335723763c55302 (diff) | |
idle: implement new protocol
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 445e2e04..aeb6f5f0 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -187,7 +187,8 @@ void CCompositor::initServer() { m_sWLRPresentation = wlr_presentation_create(m_sWLDisplay, m_sWLRBackend); - m_sWLRIdle = wlr_idle_create(m_sWLDisplay); + m_sWLRIdle = wlr_idle_create(m_sWLDisplay); + m_sWLRIdleNotifier = wlr_idle_notifier_v1_create(m_sWLDisplay); m_sWLRLayerShell = wlr_layer_shell_v1_create(m_sWLDisplay, 4); @@ -2435,3 +2436,13 @@ CWindow* CCompositor::getForceFocus() { return nullptr; } + +void CCompositor::notifyIdleActivity() { + wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat); + wlr_idle_notifier_v1_notify_activity(g_pCompositor->m_sWLRIdleNotifier, g_pCompositor->m_sSeat.seat); +} + +void CCompositor::setIdleActivityInhibit(bool inhibit) { + wlr_idle_set_enabled(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat, inhibit); + wlr_idle_notifier_v1_set_inhibited(g_pCompositor->m_sWLRIdleNotifier, inhibit); +} |
