aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-22 16:13:36 -0500
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:05:01 -0500
commitba10e3547cffacaee92d10779703824dd2fc1460 (patch)
tree0e6b149096825c30907002b026ef1e8b6f4cbe6d /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Cancel data callback if we have a fatal error (diff)
downloadefl-ba10e3547cffacaee92d10779703824dd2fc1460.tar.gz
ecore-wl2: Start on implementing support for multi-seat
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.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index dccb184486..7ccf1d1c6f 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1087,18 +1087,21 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
wl_pointer_set_user_data(input->wl.pointer, input);
wl_pointer_add_listener(input->wl.pointer, &_pointer_listener, input);
- if (!input->cursor.surface)
- {
- input->cursor.surface =
- wl_compositor_create_surface(input->display->wl.compositor);
- }
+ /* if (!input->cursor.surface) */
+ /* { */
+ /* input->cursor.surface = */
+ /* wl_compositor_create_surface(input->display->wl.compositor); */
+ /* } */
}
else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && (input->wl.pointer))
{
if (input->cursor.surface) wl_surface_destroy(input->cursor.surface);
input->cursor.surface = NULL;
- wl_pointer_destroy(input->wl.pointer);
+ if (input->seat_version >= WL_POINTER_RELEASE_SINCE_VERSION)
+ wl_pointer_release(input->wl.pointer);
+ else
+ wl_pointer_destroy(input->wl.pointer);
input->wl.pointer = NULL;
}
@@ -1110,7 +1113,10 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
}
else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && (input->wl.keyboard))
{
- wl_keyboard_destroy(input->wl.keyboard);
+ if (input->seat_version >= WL_KEYBOARD_RELEASE_SINCE_VERSION)
+ wl_keyboard_release(input->wl.keyboard);
+ else
+ wl_keyboard_destroy(input->wl.keyboard);
input->wl.keyboard = NULL;
}
@@ -1122,7 +1128,10 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
}
else if (!(caps & WL_SEAT_CAPABILITY_TOUCH) && (input->wl.touch))
{
- wl_touch_destroy(input->wl.touch);
+ if (input->seat_version >= WL_TOUCH_RELEASE_SINCE_VERSION)
+ wl_touch_release(input->wl.touch);
+ else
+ wl_touch_destroy(input->wl.touch);
input->wl.touch = NULL;
}
}
@@ -1208,7 +1217,7 @@ _ecore_wl2_input_cursor_update(void *data)
}
void
-_ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id)
+_ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int version)
{
Ecore_Wl2_Input *input;
@@ -1216,7 +1225,7 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id)
if (!input) return;
input->display = display;
-
+ input->seat_version = MIN(version, 4);
input->repeat.rate = 0.025;
input->repeat.delay = 0.4;
input->repeat.enabled = EINA_TRUE;