aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-01-13 19:24:51 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-01-13 19:40:44 +0100
commit63a410667a847c7ea90c77a83d94175716935d14 (patch)
treedcd3e28265409f160e1fd076e4b235ff21ac1e9e /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore_drm: close all devices in shutdown (diff)
downloadefl-63a410667a847c7ea90c77a83d94175716935d14.tar.gz
ecore_wl2: fix key down event called to often
if many events are coming in, a release event can be skipped. if this happens the timer continues with the new keycode. so if a new key pressed event enter checks for the old timer and delete the timer if there is one. If the timer kicks in and emits additional key down events dont call the callback which gets called by wl, and emit the signal directly.
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 1b1174d12b..4cf3c96206 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -775,9 +775,7 @@ _keyboard_cb_repeat(void *data)
window = input->focus.keyboard;
if (!window) goto out;
- if (input->focus.keyboard == window)
- _keyboard_cb_key(input, NULL, input->display->serial,
- input->repeat.time, input->repeat.key, EINA_TRUE);
+ _ecore_wl2_input_key_send(input, input->focus.keyboard, input->repeat.sym, input->repeat.key + 8, WL_KEYBOARD_KEY_STATE_PRESSED, input->repeat.time);
return ECORE_CALLBACK_RENEW;
@@ -834,6 +832,10 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned
input->repeat.key = keycode;
input->repeat.time = timestamp;
+ /* Delete this timer if there is still one */
+ if (input->repeat.timer) ecore_timer_del(input->repeat.timer);
+ input->repeat.timer = NULL;
+
if (!input->repeat.timer)
{
input->repeat.timer =