aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-06-09 12:43:50 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-06-09 12:43:50 -0500
commita4f64d6fcb3de6ff650e9a09b09c69edbb862146 (patch)
tree8779f45c2b31d625f266bf9ca60a4e4dcbc0289a /src/lib/ecore_wl2/ecore_wl2_input.c
parenteolian: support @protected for accessors (get/set) (diff)
downloadefl-a4f64d6fcb3de6ff650e9a09b09c69edbb862146.tar.gz
ecore_wl2: Fix keyboard repeat handling
Recent timer changes broke keyboard repeat under wayland - while that will probably be fixed shortly, this should be more robust and more accurate anyway.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 2b4a80419a..4761672222 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -780,6 +780,11 @@ _keyboard_cb_repeat(void *data)
_ecore_wl2_input_key_send(input, input->focus.keyboard, input->repeat.sym, input->repeat.key + 8, WL_KEYBOARD_KEY_STATE_PRESSED, input->repeat.time);
+ if (!input->repeat.repeating)
+ {
+ ecore_timer_interval_set(input->repeat.timer, input->repeat.rate);
+ input->repeat.repeating = EINA_TRUE;
+ }
return ECORE_CALLBACK_RENEW;
out:
@@ -841,9 +846,9 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned
if (!input->repeat.timer)
{
+ input->repeat.repeating = EINA_FALSE;
input->repeat.timer =
- ecore_timer_add(input->repeat.rate, _keyboard_cb_repeat, input);
- ecore_timer_delay(input->repeat.timer, input->repeat.delay);
+ ecore_timer_add(input->repeat.delay, _keyboard_cb_repeat, input);
}
}
}
@@ -903,8 +908,8 @@ _keyboard_cb_repeat_setup(void *data, struct wl_keyboard *keyboard EINA_UNUSED,
}
input->repeat.enabled = EINA_TRUE;
- input->repeat.rate = (rate / 10000);
- input->repeat.delay = (delay / 1000);
+ input->repeat.rate = (1.0 / rate);
+ input->repeat.delay = (delay / 1000.0);
}
static const struct wl_keyboard_listener _keyboard_listener =