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

powerMonitor.getSystemIdleTime() reports user idle on linux when using only keyboard (on Wayland) #27912

Open
3 tasks done
ssalenik opened this issue Feb 25, 2021 · 18 comments
Open
3 tasks done

Comments

@ssalenik
Copy link

ssalenik commented Feb 25, 2021

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Expected Behavior

When user is using only a keyboard (eg: editing files in Vim in running in a terminal emulator) powerMonitor.getSystemIdleTime() API does not detect this as idle time.

Actual Behavior

powerMonitor.getSystemIdleTime() detects the user is idle when user is using keyboard only in Vim

To Reproduce

Found this while using Super-Productivity app on latest release version 6.4.0 from Snap store. Bug filed here:
johannesjo/super-productivity#922

This app is using the powerMonitor API to detect when a user is idle to notify them after X number of minutes:
https://github.com/johannesjo/super-productivity/blob/03ff2fb0086225b9b56832e308b2751e2afc0f52/electron/main.ts#L146

Using the app I get this idle detection whenever I'm using the keyboard only in Vim for X number of minutes.

Screenshots

Additional Information

@ssalenik ssalenik changed the title powerMonitor.getSystemIdleTime() reports user idle on linux when using only keyboard powerMonitor.getSystemIdleTime() reports user idle on linux when using only keyboard (on Wayland) Feb 26, 2021
@ssalenik
Copy link
Author

After some more investigation, I believe this might be related to Wayland. Seems that most idle detection methods on Linux used XScreenSaver or something similar relying on X which probably doesn't work on Wayland.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 14, 2022
@johannesjo
Copy link

Still relevant

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Jan 14, 2023
@hovancik
Copy link

still issue electron 22

@github-actions github-actions bot removed the stale label Jan 15, 2023
@juliankoehn
Copy link

juliankoehn commented Jan 15, 2023

I am experiencing the same issue with Ubuntu Core 22 and Wayland while using Electron 22. The plugs I am using are as follows:

plugs:
- audio-playback
- hardware-observe
- power-control
- system-observe
- network
- network-bind
- opengl
- process-control
- wayland

Unfortunately, I am always receiving 'active' as the idle state. Has anyone found a workaround for this problem on Ubuntu Core 22 and Electron 22?

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Apr 16, 2023
@maymage
Copy link

maymage commented Apr 19, 2023

.

@github-actions github-actions bot removed the stale label Apr 20, 2023
@xeruf
Copy link

xeruf commented Jun 14, 2023

How about adding a label so this does not get marked as stale? This issue will stay relevant until it is fixed, which I would highly appreciate.

@electron-issue-triage
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@hovancik
Copy link

still issue

@hovancik
Copy link

still issue with 25, please remove stale

@electron-issue-triage
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@hovancik
Copy link

Bump

@meenakshi-koushik
Copy link

I can easily reproduce this problem with electron v28 (and probably also with earlier versions) using electron-quick-start. By periodically logging powerMonitor.getSystemIdleTime() in main.js. When I run the app in X, the idle time reported increases monotonously as soon as I stop using keyboard/ mouse, while in Wayland (ubuntu 22.04, gnome) the idle time is always reported as 0.

@wolftune
Copy link

incidentally, I have heard there are multiple idle-time protocols in Wayland. KDE (kwin) has a different one from some other frameworks or something. I hope they will all be supported.

@electron-issue-triage
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@mcmxcdev
Copy link

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests