Bug 449488 - GetSessionIdleTime always returns 0 on Wayland
Summary: GetSessionIdleTime always returns 0 on Wayland
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.23.5
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2022-02-02 08:33 UTC by fox
Modified: 2022-10-24 18:36 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.100
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fox 2022-02-02 08:33:06 UTC
How to reproduce:

```
$ sleep 2; qdbus org.freedesktop.ScreenSaver /ScreenSaver GetSessionIdleTime
0
``` 

It seems to work properly when using Plasma (X11) session. Using Fedora Kinoite (latest, as of 2022.02.02).

- KDE Plasma 5.23.5
- KDE Frameworks 5.90.0
- Qt 5.15.2
- Kernel 5.15.18
- Wayland (amdgpu)

Thanks in advance for any help.
Comment 1 Ilya Fedin 2022-07-28 08:54:18 UTC
This bug makes some applications work buggy. E.g. if I don't use computer for a while, Telegram should stop marking messages as read and start sending notifications even there's opened chat. That doesn't happen due to the bugged response. Telegram's auto-lock feature doesn't work as well.
Comment 2 Weng Xuetian 2022-07-28 14:17:28 UTC
ScreenSaver service is provided by kwin_wayland on wayland session.

The return value comes from kwin's own kidle time implementation, which is at
https://invent.kde.org/plasma/kwin/-/blob/master/src/plugins/idletime/poller.cpp#L79

We would just need to have a valid implementation for it.
Comment 3 Vlad Zahorodnii 2022-07-28 17:17:11 UTC
(In reply to Weng Xuetian from comment #2)
> ScreenSaver service is provided by kwin_wayland on wayland session.
> 
> The return value comes from kwin's own kidle time implementation, which is at
> https://invent.kde.org/plasma/kwin/-/blob/master/src/plugins/idletime/poller.
> cpp#L79
> 
> We would just need to have a valid implementation for it.

That code is used for stuff inside kwin, kscreenlocker should use kidle integration provided in kwayland-integration
Comment 4 Bug Janitor Service 2022-07-28 18:24:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2749
Comment 5 Bug Janitor Service 2022-10-20 12:15:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/107
Comment 6 David Redondo 2022-10-24 13:51:39 UTC
Git commit a4244d3cb7254d887e033062e6a1b640ef094af6 by David Redondo.
Committed on 24/10/2022 at 13:04.
Pushed by davidre into branch 'master'.

Screensaver interface: Send an error for GetSessionIdleTime on wayland

It's not supported, let's tell applciations that.

M  +6    -0    interface.cpp

https://invent.kde.org/plasma/kscreenlocker/commit/a4244d3cb7254d887e033062e6a1b640ef094af6