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:17:06 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commited7429f62de960008f38113850467e44d23d833f (patch)
treed78e627f6d93936b8a196a7aa37abc0f40fd6018 /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Add code to send mouse move events (diff)
downloadefl-ed7429f62de960008f38113850467e44d23d833f.tar.gz
ecore-wl2: Issue input grab/ungrab during pointer button 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.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index decb03f98a..6488d1b858 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -85,6 +85,25 @@ _ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
}
static void
+_ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button)
+{
+ input->grab.window = window;
+ input->grab.button = button;
+}
+
+static void
+_ecore_wl2_input_ungrab(Ecore_Wl2_Input *input)
+{
+ if ((input->grab.window) && (input->grab.button))
+ {
+ /* TODO: send a mouse up here */
+ }
+
+ input->grab.window = NULL;
+ input->grab.button = 0;
+}
+
+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;
@@ -177,7 +196,7 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
{
if ((input->focus.pointer) && (!input->grab.window))
{
- /* TODO: issue input grab */
+ _ecore_wl2_input_grab(input, input->focus.pointer, button);
input->grab.timestamp = timestamp;
}
@@ -194,9 +213,7 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned
}
if ((input->grab.window) && (input->grab.button == button))
- {
- /* TODO: issue input ungrab */
- }
+ _ecore_wl2_input_ungrab(input);
}
}
@@ -668,25 +685,6 @@ static const struct wl_seat_listener _seat_listener =
};
static void
-_ecore_wl2_input_grab(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, unsigned int button)
-{
- input->grab.window = window;
- input->grab.button = button;
-}
-
-static void
-_ecore_wl2_input_ungrab(Ecore_Wl2_Input *input)
-{
- if ((input->grab.window) && (input->grab.button))
- {
- /* TODO: send a mouse up here */
- }
-
- input->grab.window = NULL;
- input->grab.button = 0;
-}
-
-static void
_ecore_wl2_input_cursor_setup(Ecore_Wl2_Input *input)
{
char *tmp;