aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-09-23 11:13:44 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commit8a2b8ed76a1d7b3f21c10b3d2c3e80e52a1132b6 (patch)
tree5ee6b6756d6a061de05c5a5933c51f753ac68bf5 /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Add functions to send mouse in/out events and call them (diff)
downloadefl-8a2b8ed76a1d7b3f21c10b3d2c3e80e52a1132b6.tar.gz
ecore-wl2: Add code to send mouse move events
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.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 45f2fd11e3..decb03f98a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -28,8 +28,8 @@ _ecore_wl2_input_mouse_in_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window)
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
- ev->window = window;
- ev->event_window = window;
+ ev->window = window->id;
+ ev->event_window = window->id;
ev->timestamp = input->timestamp;
ev->modifiers = input->keyboard.modifiers;
@@ -46,8 +46,8 @@ _ecore_wl2_input_mouse_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window
ev->x = input->pointer.sx;
ev->y = input->pointer.sy;
- ev->window = window;
- ev->event_window = window;
+ ev->window = window->id;
+ ev->event_window = window->id;
ev->timestamp = input->timestamp;
ev->modifiers = input->keyboard.modifiers;
@@ -55,6 +55,36 @@ _ecore_wl2_input_mouse_out_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window
}
static void
+_ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, int device)
+{
+ Ecore_Event_Mouse_Move *ev;
+
+ ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
+ if (!ev) return;
+
+ ev->window = window->id;
+ ev->event_window = window->id;
+ ev->timestamp = input->timestamp;
+ ev->x = input->pointer.sx;
+ ev->y = input->pointer.sy;
+ ev->root.x = input->pointer.sx;
+ ev->root.y = input->pointer.sy;
+ ev->modifiers = input->keyboard.modifiers;
+ ev->multi.device = device;
+ ev->multi.radius = 1;
+ ev->multi.radius_x = 1;
+ ev->multi.radius_y = 1;
+ ev->multi.pressure = 1.0;
+ ev->multi.angle = 0.0;
+ ev->multi.x = input->pointer.sx;
+ ev->multi.y = input->pointer.sy;
+ ev->multi.root.x = input->pointer.sx;
+ ev->multi.root.y = input->pointer.sy;
+
+ ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+}
+
+static void
_pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
{
Ecore_Wl2_Input *input;
@@ -123,6 +153,7 @@ _pointer_cb_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
window = input->focus.pointer;
if (!window) return;
+ input->timestamp = timestamp;
input->pointer.sx = wl_fixed_to_double(sx);
input->pointer.sy = wl_fixed_to_double(sy);
@@ -131,7 +162,7 @@ _pointer_cb_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
/* (input->pointer.sy > window->geometry.h)) */
/* return; */
- /* TODO: send mouse move event */
+ _ecore_wl2_input_mouse_move_send(input, window, 0);
}
static void