RSIBreak / KIdleTime on Wayland

Albert Astals Cid aacid at kde.org
Sun Nov 15 20:54:19 GMT 2020


El dissabte, 14 de novembre de 2020, a les 12:46:41 CET, Dominik Waurenschk va escriure:
> 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?

I agree, if we can't make the KIdleTime framework work in Wayland there should be a way to query the framework if it's going to work or not.

CC'ing the frameworks devel list.

Cheers,
  Albert

> 
> Thank you,
> Dominik
> 







More information about the kde-devel mailing list