diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -1589,18 +1589,21 @@ [this] (const QSizeF &delta) { // TODO: Fix time m_pointer->processMotion(globalPointer() + QPointF(delta.width(), delta.height()), 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::pointerButtonPressRequested, this, [this] (quint32 button) { // TODO: Fix time m_pointer->processButton(button, InputRedirection::PointerButtonPressed, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::pointerButtonReleaseRequested, this, [this] (quint32 button) { // TODO: Fix time m_pointer->processButton(button, InputRedirection::PointerButtonReleased, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::pointerAxisRequested, this, @@ -1620,24 +1623,28 @@ } // TODO: Fix time m_pointer->processAxis(axis, delta, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::touchDownRequested, this, [this] (quint32 id, const QPointF &pos) { // TODO: Fix time m_touch->processDown(id, pos, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::touchMotionRequested, this, [this] (quint32 id, const QPointF &pos) { // TODO: Fix time m_touch->processMotion(id, pos, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::touchUpRequested, this, [this] (quint32 id) { // TODO: Fix time m_touch->processUp(id, 0); + waylandServer()->simulateUserActivity(); } ); connect(device, &FakeInputDevice::touchCancelRequested, this, diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -45,6 +45,7 @@ class CompositorInterface; class Display; class DataDeviceInterface; +class IdleInterface; class ShellInterface; class SeatInterface; class ServerSideDecorationManagerInterface; @@ -192,6 +193,8 @@ **/ SocketPairConnection createConnection(); + void simulateUserActivity(); + Q_SIGNALS: void shellClientAdded(KWin::ShellClient*); void shellClientRemoved(KWin::ShellClient*); @@ -223,6 +226,7 @@ KWayland::Server::OutputManagementInterface *m_outputManagement = nullptr; KWayland::Server::AppMenuManagerInterface *m_appMenuManager = nullptr; KWayland::Server::ServerSideDecorationPaletteManagerInterface *m_paletteManager = nullptr; + KWayland::Server::IdleInterface *m_idle = nullptr; struct { KWayland::Server::ClientConnection *client = nullptr; QMetaObject::Connection destroyConnection; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -249,9 +249,9 @@ } } ); - auto idle = m_display->createIdle(m_display); - idle->create(); - auto idleInhibition = new IdleInhibition(idle); + m_idle = m_display->createIdle(m_display); + m_idle->create(); + auto idleInhibition = new IdleInhibition(m_idle); connect(this, &WaylandServer::shellClientAdded, idleInhibition, &IdleInhibition::registerShellClient); m_display->createIdleInhibitManager(IdleInhibitManagerInterfaceVersion::UnstableV1, m_display)->create(); m_plasmaShell = m_display->createPlasmaShell(m_display); @@ -749,4 +749,11 @@ return !m_initFlags.testFlag(InitalizationFlag::NoLockScreenIntegration); } +void WaylandServer::simulateUserActivity() +{ + if (m_idle) { + m_idle->simulateUserActivity(); + } +} + }