ecore-wl: Don't create an input cursor surface unless the input has pointer capability.

@fix: There is no use for an input cursor surface if the seat does not
have the pointer ability (for kiosk cases, or touch-only cases where
a pointer is not created).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-04-15 10:36:37 +01:00
parent c53053f2aa
commit 6699d427c1
1 changed files with 10 additions and 2 deletions

View File

@ -354,8 +354,6 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
input->seat);
wl_data_device_add_listener(input->data_device,
&_ecore_wl_data_listener, input);
input->cursor_surface =
wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
ewd->input = input;
}
@ -447,14 +445,24 @@ _ecore_wl_input_seat_handle_capabilities(void *data, struct wl_seat *seat, enum
if (!(input = data)) return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((caps & WL_SEAT_CAPABILITY_POINTER) && (!input->pointer))
{
input->pointer = wl_seat_get_pointer(seat);
wl_pointer_set_user_data(input->pointer, input);
wl_pointer_add_listener(input->pointer, &pointer_listener, input);
if (!input->cursor_surface)
{
input->cursor_surface =
wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
}
}
else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && (input->pointer))
{
if (input->cursor_surface) wl_surface_destroy(input->cursor_surface);
input->cursor_surface = NULL;
wl_pointer_destroy(input->pointer);
input->pointer = NULL;
}