summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2019-01-29 07:06:33 -0500
committerChristopher Michael <cp.michael@samsung.com>2019-01-29 07:06:33 -0500
commit3bedc63315d8ff32e8db7dc99697d6c1bbf8a79d (patch)
treefcbb943ea9ebe54b0ed16f30e38c420210b5d1f5 /src/lib/ecore_wl2/ecore_wl2_input.c
parenta016f8e592d8e1fed68e231cda62313e9ac178a7 (diff)
ecore_wl2_input: update a timestamp whenever possible
Summary: gettimeofday function returns a accumulated timestamp since around 1970 by the way, a argument from server looks like a system uptime based timestamp in some distribution such as tizen. so that this patch appends a logic that updates a timestamp inside Ecore_Wl2_Input* whenever possible to prevent gettimeofday function from being called. Reviewers: #reviewers, cedric, devilhorns Reviewed By: #reviewers, devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7766
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 721f6a10ee..0d480f50e8 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -765,6 +765,7 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
765 if (!input) return; 765 if (!input) return;
766 766
767 input->display->serial = serial; 767 input->display->serial = serial;
768 input->timestamp = timestamp;
768 769
769 if (state == WL_POINTER_BUTTON_STATE_PRESSED) 770 if (state == WL_POINTER_BUTTON_STATE_PRESSED)
770 { 771 {
@@ -802,6 +803,8 @@ _pointer_cb_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned in
802 input = data; 803 input = data;
803 if (!input) return; 804 if (!input) return;
804 805
806 input->timestamp = timestamp;
807
805 _ecore_wl2_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value), 808 _ecore_wl2_input_mouse_wheel_send(input, axis, wl_fixed_to_int(value),
806 timestamp); 809 timestamp);
807} 810}
@@ -1056,6 +1059,7 @@ _keyboard_cb_key(void *data, struct wl_keyboard *keyboard EINA_UNUSED, unsigned
1056 if (!window) return; 1059 if (!window) return;
1057 1060
1058 input->display->serial = serial; 1061 input->display->serial = serial;
1062 input->timestamp = timestamp;
1059 1063
1060 /* xkb rules reflect X broken keycodes, so offset by 8 */ 1064 /* xkb rules reflect X broken keycodes, so offset by 8 */
1061 code = keycode + 8; 1065 code = keycode + 8;
@@ -1205,6 +1209,7 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri
1205 if (!window) return; 1209 if (!window) return;
1206 1210
1207 input->focus.touch = window; 1211 input->focus.touch = window;
1212 input->timestamp = timestamp;
1208 1213
1209 _pointer_cb_enter(data, NULL, serial, surface, x, y); 1214 _pointer_cb_enter(data, NULL, serial, surface, x, y);
1210 1215