evdev: Do not start/stop softrepeat callout if no clients attached

Reviewed by:		gonzo
Approved by:		gonzo (mentor)
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D12676
This commit is contained in:
wulf 2017-11-01 22:37:43 +00:00
parent 991f78897d
commit 2b4533cfe9

View File

@ -579,7 +579,8 @@ evdev_modify_event(struct evdev_dev *evdev, uint16_t type, uint16_t code,
*value = KEY_EVENT_REPEAT;
} else {
/* Start/stop callout for evdev repeats */
if (bit_test(evdev->ev_key_states, code) == !*value) {
if (bit_test(evdev->ev_key_states, code) == !*value &&
!LIST_EMPTY(&evdev->ev_clients)) {
if (*value == KEY_EVENT_DOWN)
evdev_start_repeat(evdev, code);
else