RSIBreak / KIdleTime on Wayland
Dominik Waurenschk
dominik.waurenschk at protonmail.com
Sat Nov 14 11:46:41 GMT 2020
Hi, I just came across the issue that RSIBreak is unable to count down in wayland, after 1 second it always resets its timer.
I investigated the code and found that it calls KIdleTime, which in turn calls a platform-specific plugin.
In particular, it calls forcePollRequest() to get the current idle time (instead of waiting for a timeout event or similar)
For Wayland this function prints a warning that this plugin doesn't support polling idle time, but then always returns 0, which RSIBreak later interprets as activity, since it thinks 0 seconds passed, this halting the countdown.
This plugin in turn uses KWayland::Client::Idle, which does indeed seem to only support timeouts and no getting the actual idle time. So if it is really not possible to count idle time in wayland (I don't know enough about wayland to implement it myself at this time), then I think it would be useful to, instead of only printing a warning to console/log, the function would actually return some type of error code to the caller. (It could return -1, or throw an exception, or similar)
So then the caller can react to the fact that polling is not supported, and could perhaps implement a different way of measuring time on that platform. (it could perhaps use its own timer and reset when the platform plugin emits resumingFromIdle, i haven't tried out how this works yet).
So do you think it makes sense to have the function return some form or error instead of just returning 0, or is there a good reason it is not doing that already?
Thank you,
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 509 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20201114/09a4051b/attachment.sig>
More information about the kde-devel
mailing list