aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-09-10 13:39:25 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commit4731bb6eed6fc526ab3bc0256775500b071f2f3c (patch)
treee9b3cdc30a06a8bede6c617519d82aa6b36d5c17 /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Start on code for pointer motion event (diff)
downloadefl-4731bb6eed6fc526ab3bc0256775500b071f2f3c.tar.gz
ecore-wl2: Add start of code for pointer button event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index b417423c37..a5b4ef628c 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -54,6 +54,7 @@ static void
_pointer_cb_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, wl_fixed_t sx, wl_fixed_t sy)
{
Ecore_Wl2_Input *input;
+ Ecore_Wl2_Window *window;
input = data;
if (!input) return;
@@ -62,9 +63,6 @@ _pointer_cb_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
window = input->focus.pointer;
if (!window) return;
- /* trap for a surface that was just destroyed */
- if (!surface) return;
-
input->pointer.sx = wl_fixed_to_double(sx);
input->pointer.sy = wl_fixed_to_double(sy);
@@ -83,6 +81,32 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
input = data;
if (!input) return;
+
+ if (state == WL_POINTER_BUTTON_STATE_PRESSED)
+ {
+ if ((input->focus.pointer) && (!input->grab.window))
+ {
+ /* TODO: issue input grab */
+ input->grab.timestamp = timestamp;
+ }
+
+ if (input->focus.pointer)
+ {
+ /* TODO: send mouse down event */
+ }
+ }
+ else
+ {
+ if (input->focus.pointer)
+ {
+ /* TODO: send mouse up event */
+ }
+
+ if ((input->grab.window) && (input->grab.button == button))
+ {
+ /* TODO: issue input ungrab */
+ }
+ }
}
static void