summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-09-12 14:56:58 +0100
committerChris Michael <cp.michael@samsung.com>2013-09-12 15:02:34 +0100
commit0d0944c4ccee3f27cf3769ecf94e408594ac135c (patch)
treedeb8e78d1fcfa42b319693dc7d3050191303c2f4
parentf4f44c777ad410eaea152cc8745ca641ea2c2d5a (diff)
Reduce unnecessary pointer frame callbacks
NB: We only need to do pointer frame callbacks if the pointer is using an animated image. Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index 8352552877..20f7381905 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -196,6 +196,8 @@ _ecore_wl_input_cursor_update(void *data)
196 unsigned int delay; 196 unsigned int delay;
197 197
198 cursor_image = input->cursor->images[input->cursor_current_index]; 198 cursor_image = input->cursor->images[input->cursor_current_index];
199 if (!cursor_image) return ECORE_CALLBACK_RENEW;
200
199 if ((buffer = wl_cursor_image_get_buffer(cursor_image))) 201 if ((buffer = wl_cursor_image_get_buffer(cursor_image)))
200 { 202 {
201 ecore_wl_input_pointer_set(input, input->cursor_surface, 203 ecore_wl_input_pointer_set(input, input->cursor_surface,
@@ -206,7 +208,7 @@ _ecore_wl_input_cursor_update(void *data)
206 cursor_image->width, cursor_image->height); 208 cursor_image->width, cursor_image->height);
207 wl_surface_commit(input->cursor_surface); 209 wl_surface_commit(input->cursor_surface);
208 210
209 if (!input->cursor_frame_cb) 211 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
210 _ecore_wl_input_cb_pointer_frame(input, NULL, 0); 212 _ecore_wl_input_cb_pointer_frame(input, NULL, 0);
211 } 213 }
212 214
@@ -515,7 +517,7 @@ _ecore_wl_input_cb_pointer_frame(void *data, struct wl_callback *callback, unsig
515 return; 517 return;
516 } 518 }
517 519
518 if (!input->cursor_frame_cb) 520 if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
519 { 521 {
520 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface); 522 input->cursor_frame_cb = wl_surface_frame(input->cursor_surface);
521 wl_callback_add_listener(input->cursor_frame_cb, 523 wl_callback_add_listener(input->cursor_frame_cb,