inclement / vivarium

A dynamic tiling Wayland compositor using wlroots
GNU General Public License v3.0
367 stars 13 forks source link

Idle inhibit protocol #100

Closed flaviozavan closed 2 years ago

flaviozavan commented 2 years ago

Introduces support for the idle inhibit protocol (idle-inhibit-unstable-v1). According to the protocol description, visible surfaces can prevent displays from entering the idle state. The introduced code supports xdg, xwayland, and layer surfaces. Though, in practice, this is limited to what wlroots signals (i.e. no xwayland)


I have been using this with no issues so far. An easy way to test is to fire up swayidle with a low timeout: swayidle timeout 5 xeyes

Make sure it's working. Then launch mpv, make sure it doesn't go idle. Then move mpv to another workspace, make sure it goes idle. Then switch to that workspace, make sure it doesn't go idle. Then move it back, ensure it does. Then switch back, ensure it doesn't. Then close it, ensure it does.

I am open to alternatives to updating the state on relayout. The idea is that if it's done late in the changes-to-views workflows, the code can be simplified and only call it in one place.

flaviozavan commented 2 years ago

Today I ran into a segfault related to this, I'll investigate and fix

flaviozavan commented 2 years ago

I have been using this everyday for over a month now. It's been stable, and I guess it's ready for a review.

inclement commented 2 years ago

Looks good to me, and it looks like the tests failed for no good reason. Annoyingly I can't work out how to re-run them, would you mind force pushing or something just to make them run again and (presumably) pass?

flaviozavan commented 2 years ago

I rebased and force pushed. Hopefully that works