Gaming peripherals do not reset the idle timer
andersnylander opened this issue · 8 comments
Title says it all. I connect my steering wheel to the PC (A Logitech G29, though I don't think brand matters here), fire up my game, start playing. A few minutes in I start cursing because my lockscreen shows up out of nowhere.
Now there could be some serious misunderstanding I've made in how swaywm/swayidle is setup that would allow swayidle to "hear" input from the wheel, but at the moment I'm stumped.
I've also tried it with a bluetooth gamepad with the same result.
My current workaround of killing swayidle whenever I want to play a game using such a peripheral is, to be perfectly honest, not the most convenient one.
Wayland doesn't manage your gaming devices.
I am experiencing the same problem; why is this seen as a non-issue?
Is there any workaround for this, besides disabling idle entirely?
Games can request to inhibit idle, and you can configure Sway to inhibit idle when an application is active.
Thanks @emersion for the fast response.
For future reference I added the following line to my Sway config:
for_window [class="steam_app*"] inhibit_idle focus
Which solved my problem in most (but not all) Steam Games.
Shouldn't the activity from a game controller inhibit idle, the same way a mouse does?
No, unless the game controller presents itself as a mouse or keyboard (or tablet/touchscreen). Otherwise, the input is simply not routed through Sway, so Sway can't do anything in response.
Could you check for input from controllers through the evdev API
or would that break certain games, or would that code be hacky and unwanted here?
Saw this question answered
I think sway uses libinput instead of evdev directly. I'm not sure if that is the case but if it is, that explains why controllers and other peripherals don't inhibit the lock.