summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-03-12 15:49:03 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-03-12 15:56:34 -0400
commit37c2451b5f02895f9eb8686da56698135eeec658 (patch)
tree17ea641738940c29eb002bfdd7539853ba355b3e
parent5ff4539333567de16e58b5bb3f90fe89d1354886 (diff)
ecore-wl cursor setup no longer triggers errors on startup
@fix T2202
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_wayland/ecore_wl.c6
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c33
-rw-r--r--src/lib/ecore_wayland/ecore_wl_private.h1
3 files changed, 22 insertions, 18 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c
index 7e6d46d210..044696490b 100644
--- a/src/lib/ecore_wayland/ecore_wl.c
+++ b/src/lib/ecore_wayland/ecore_wl.c
@@ -662,11 +662,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
662 ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1); 662 ewd->wl.shm = wl_registry_bind(registry, id, &wl_shm_interface, 1);
663 663
664 if (ewd->input) 664 if (ewd->input)
665 { 665 _ecore_wl_input_setup(ewd->input);
666 ewd->cursor_theme =
667 wl_cursor_theme_load(ewd->input->cursor_theme_name,
668 ewd->input->cursor_size, ewd->wl.shm);
669 }
670 else 666 else
671 { 667 {
672 ewd->cursor_theme = 668 ewd->cursor_theme =
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index 32f7e55b55..c91e6b7896 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -356,14 +356,29 @@ ecore_wl_input_seat_get(Ecore_Wl_Input *input)
356} 356}
357 357
358/* local functions */ 358/* local functions */
359void 359void
360_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) 360_ecore_wl_input_setup(Ecore_Wl_Input *input)
361{ 361{
362 Ecore_Wl_Input *input;
363 char *temp; 362 char *temp;
364 unsigned int cursor_size; 363 unsigned int cursor_size;
365 char *cursor_theme_name; 364 char *cursor_theme_name;
366 365
366 temp = getenv("ECORE_WL_CURSOR_SIZE");
367 if (temp)
368 cursor_size = atoi(temp);
369 else
370 cursor_size = ECORE_WL_DEFAULT_CURSOR_SIZE;
371 ecore_wl_input_cursor_size_set(input, cursor_size);
372
373 cursor_theme_name = getenv("ECORE_WL_CURSOR_THEME_NAME");
374 ecore_wl_input_cursor_theme_name_set(input, cursor_theme_name);
375}
376
377void
378_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
379{
380 Ecore_Wl_Input *input;
381
367 LOGFN(__FILE__, __LINE__, __FUNCTION__); 382 LOGFN(__FILE__, __LINE__, __FUNCTION__);
368 383
369 if (!(input = malloc(sizeof(Ecore_Wl_Input)))) return; 384 if (!(input = malloc(sizeof(Ecore_Wl_Input)))) return;
@@ -375,16 +390,8 @@ _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
375 input->keyboard_focus = NULL; 390 input->keyboard_focus = NULL;
376 input->touch_focus = NULL; 391 input->touch_focus = NULL;
377 392
378 temp = getenv("ECORE_WL_CURSOR_SIZE"); 393 if (ewd->wl.shm)
379 if (temp) 394 _ecore_wl_input_setup(input);
380 cursor_size = atoi(temp);
381 else
382 cursor_size = ECORE_WL_DEFAULT_CURSOR_SIZE;
383 ecore_wl_input_cursor_size_set(input, cursor_size);
384
385 cursor_theme_name = getenv("ECORE_WL_CURSOR_THEME_NAME");
386 ecore_wl_input_cursor_theme_name_set(input, cursor_theme_name);
387
388 input->seat = 395 input->seat =
389 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1); 396 wl_registry_bind(ewd->wl.registry, id, &wl_seat_interface, 1);
390 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input)); 397 ewd->inputs = eina_inlist_append(ewd->inputs, EINA_INLIST_GET(input));
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h
index 52b7a9b509..d0aeeb5f57 100644
--- a/src/lib/ecore_wayland/ecore_wl_private.h
+++ b/src/lib/ecore_wayland/ecore_wl_private.h
@@ -286,6 +286,7 @@ Eina_Hash *_ecore_wl_window_hash_get(void);
286void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id); 286void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id);
287void _ecore_wl_output_del(Ecore_Wl_Output *output); 287void _ecore_wl_output_del(Ecore_Wl_Output *output);
288 288
289void _ecore_wl_input_setup(Ecore_Wl_Input *input);
289void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id); 290void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id);
290void _ecore_wl_input_del(Ecore_Wl_Input *input); 291void _ecore_wl_input_del(Ecore_Wl_Input *input);
291void _ecore_wl_input_pointer_xy_get(int *x, int *y); 292void _ecore_wl_input_pointer_xy_get(int *x, int *y);