diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -1580,18 +1580,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, @@ -1611,24 +1614,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; @@ -191,6 +192,8 @@ **/ SocketPairConnection createConnection(); + void simulateUserActivity(); + Q_SIGNALS: void shellClientAdded(KWin::ShellClient*); void shellClientRemoved(KWin::ShellClient*); @@ -221,6 +224,7 @@ KWayland::Server::ServerSideDecorationManagerInterface *m_decorationManager = nullptr; KWayland::Server::OutputManagementInterface *m_outputManagement = nullptr; KWayland::Server::AppMenuManagerInterface *m_appMenuManager = 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 @@ -245,9 +245,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); @@ -736,4 +736,11 @@ return !m_initFlags.testFlag(InitalizationFlag::NoLockScreenIntegration); } +void WaylandServer::simulateUserActivity() +{ + if (m_idle) { + m_idle->simulateUserActivity(); + } +} + }