Ignore idle inhibitors from surfaces which are not visible
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.1k
- Forks
- 237
- Avg merge
- 1h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
By default, the idle plugin deactivates DPMS timers whenever an application runs fullscreen. Which makes perfect sense for watching videos and stuff. Still, this only applies when the workspace with the fullscreen app is in focus.
If the terminal application kitty is started with '--start-as=fullscreen', DPMS timers will stay disabled until the kitty application has been disabled. Independent of kitty still being fullscreen or even in the current workspace.
To Reproduce
Steps to reproduce the behavior:
0. install kitty
- configure the [idle] plugin with dpms_timeout = 60
- start wayfire like this: wayfire -d | tee wayfire.debug.out
- start some terminal in workspace A, tail -f wayfire.debug.out
- change to workspace B, start firefox, make it fullscreen with F11
- switch back to workspace A, verify that you see 'Enabling idle timers for all seats' whenever you switch away from workspace B with the fullscreen firefox session, and vice versa.
- Now start 'kitty --start-as=fullscreen' in workspace C.
- switch back to workspace A and notice how idle timers were disabled when kitty was started, but does not enable when going back to workspace A.
- switching kitty to windowed mode (
<super> UPin my config) does not change anything.
Expected behavior
I would expect DPMS timers to behave the same, independent of which application is started in fullscreen.
Screenshots or stacktrace
Dropping in and out of a workspace with a fullscreen kitty will render this in the debug log:
DD 05-09-23 22:26:30.650 - [wayfire-0.7.5/src/core/idle.cpp:15] creating idle inhibitor %p, previous count: %d0x55efa16e1af00
DD 05-09-23 22:26:30.650 - [types/wlr_idle.c:183] Disabling idle timers for all seats
DD 05-09-23 22:26:30.654 - [wayfire-0.7.5/src/core/idle.cpp:15] creating idle inhibitor %p, previous count: %d0x55efa13482a01
DD 05-09-23 22:26:33.485 - [wayfire-0.7.5/src/core/idle.cpp:23] destroying idle inhibitor %p, previous count: %d0x55efa13482a02
DD 05-09-23 22:27:58.790 - [wayfire-0.7.5/src/core/idle.cpp:15] creating idle inhibitor %p, previous count: %d0x55efa13482a01
DD 05-09-23 22:28:02.403 - [wayfire-0.7.5/src/core/idle.cpp:23] destroying idle inhibitor %p, previous count: %d0x55efa13482a02
DD 05-09-23 22:29:21.893 - [wayfire-0.7.5/src/core/idle.cpp:23] destroying idle inhibitor %p, previous count: %d0x55efa16e1af01
But only by killing said kitty terminal (independent of fullscreen state or not, will I get the following:
DD 05-09-23 22:29:21.893 - [types/wlr_idle.c:183] Enabling idle timers for all seats
This does not occur with firefox in a fullscreen session. Here, I get :
DD 05-09-23 22:38:45.695 - [wayfire-0.7.5/src/core/idle.cpp:15] creating idle inhibitor %p, previous count: %d0x55efa13482a00
DD 05-09-23 22:38:45.695 - [types/wlr_idle.c:183] Disabling idle timers for all seats
DD 05-09-23 22:39:36.678 - [wayfire-0.7.5/src/core/idle.cpp:23] destroying idle inhibitor %p, previous count: %d0x55efa13482a01
DD 05-09-23 22:39:36.678 - [types/wlr_idle.c:183] Enabling idle timers for all seats
... every time I drop in and out of the workspace with the firefox session in a fullscreen session. Killing firefox is not necessary for DPMS to kick in.
Wayfire version
0.7.5-r1 gentoo
I logged this issue with wayfire because I get excellent service here. Sorry. If the blame lies with kitty or glfw, maybe you guys can add an ever so tiny layer of what-am-I-talking-about-here, before I go to either of those?
Side note:
How can I get some kind of idea about the state of the idle plugin? I can toggle it with a hot-key, is there a way to query the state?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/core/idle.cpp and the idle handling referenced in types/wlr_idle.c, then reproduce the workspace-switching behavior with kitty and Firefox using the listed debug commands. Compare inhibitor creation and destruction for fullscreen surfaces in visible and non-visible workspaces. Done means DPMS timers are re-enabled when a fullscreen surface is no longer visible, without requiring the application to exit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100