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)
Please register or sign in to comment