Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workrave doesn't recognize watching video as idle time on some Wayland compositors #565

Open
jjramsey opened this issue Jul 19, 2024 · 4 comments
Labels
area: activity-monitoring bug Something isn't working env: wayland Wayland specific

Comments

@jjramsey
Copy link
Contributor

jjramsey commented Jul 19, 2024

Describe the bug
If I watch a YouTube video in Firefox on Labwc or Hyprland, Workrave will act as if I'm not idle, even if I'm not touching the mouse or keyboard.

Workrave behaves as desired on KDE, though.

Expected behavior
Workrave should recognize idle time as, well, idle time.

** Linux (please complete the following information in case you encountered the bug on Linux):**

  • Distribution: Arch Linux
  • Distribution Version: Rolling
  • Desktop Environment: Varying from KDE to Labwc or Hyprland
  • Workrave Version: 1.11.0_beta.14.31.g0aa1d00-1

Additional context

I have a strong suspicion that this has something to do with the Wayland idle inhibit protocol, as well as different apps having different ideas on what "idle" means (i.e., where the user in front of the keyboard is idle or if the computer itself is.)

[I had a rant here that sort of amounted to "idle inhibit considered harmful", but I got rid of it because, well, it was a rant.]

@jjramsey
Copy link
Contributor Author

jjramsey commented Jul 20, 2024

One thing that seems to have helped is installing xdg-desktop-portal-gtk on Arch, which implements the org.freedesktop.impl.portal.Inhibit interface. I think what this does is allow Firefox to send dbus messages that inhibit idle without having the Wayland compositor treat that as non-idleness, but I'm not sure.

(Interestingly enough, the issue that plagued me seems to have been discussed about 4 years ago but possibly resolved too simply: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29#note_561742 Maybe you can yell at whoever handles the Wayland protocols to get a revision?)

@jjramsey
Copy link
Contributor Author

FWIW, I've posted an issue on the Wayland protocols Gitlab related to the problem that I described: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/213

@rcaelers
Copy link
Owner

rcaelers commented Sep 17, 2024

In the GNOME/Mutter activity monitor, I switch to polling when an "Inhibit" is received from the GNOME session manager. Something similar may be possible in Wayland. I will check if I can reproduce this.

@rcaelers rcaelers added env: wayland Wayland specific bug Something isn't working area: activity-monitoring labels Sep 17, 2024
@jjramsey
Copy link
Contributor Author

jjramsey commented Nov 1, 2024

In the GNOME/Mutter activity monitor, I switch to polling when an "Inhibit" is received from the GNOME session manager. Something similar may be possible in Wayland.

I'm not sure how you'd pull it off. If I look at the current Wayland idle-inhibit protocol, there's a way for a Wayland client to create an inhibitor object and to destroy one, but no way for some other Wayland client to detect if an inhibitor object has been created.

Honestly, I'm not sure if there's a way around the problem that doesn't involve deprecating or reworking the idle inhibit protocol. Unfortunately, there doesn't seem to be much movement about the issue I posted on the Wayland protocol Gitlab about this. Maybe you could help get some attention on the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: activity-monitoring bug Something isn't working env: wayland Wayland specific
Projects
None yet
Development

No branches or pull requests

2 participants