Skip to content
Commit 701c804c authored by Bartosz Taudul's avatar Bartosz Taudul Committed by Joshua Goins
Browse files

kcms/joystick: only sleep if there are no events to process

Always issuing a 10 ms sleep, even when joystick events were processed, is
less than ideal. It locks the UI update rate to no more than 100 FPS, which is
slower than modern displays can update.

This change restores the previous behavior of waiting for a timeout in a
select call monitoring joystick events. The difference is that the timeout is
only issued while querying the first event, and all subsequent events in the
current tick are processed with a zero timeout.

The result is that if there are no events, the event processing logic will
sleep. However, if there is a continuous stream of incoming events, the events
will be consumed until there are none left, and then the UI will be refreshed
immediately. The event processing loop will then resume without delay.

(cherry picked from commit f1024091)
parent 575e99f5
Pipeline #322563 passed with stage
in 4 minutes and 1 second
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment