devilhorns pushed a commit to branch master.

commit 0d0944c4ccee3f27cf3769ecf94e408594ac135c
Author: Chris Michael <[email protected]>
Date:   Thu Sep 12 14:56:58 2013 +0100

    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 <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl_input.c | 6 ++++--
 1 file 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 8352552..20f7381 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)
    unsigned int delay;
 
    cursor_image = input->cursor->images[input->cursor_current_index];
+   if (!cursor_image) return ECORE_CALLBACK_RENEW;
+
    if ((buffer = wl_cursor_image_get_buffer(cursor_image)))
      {
         ecore_wl_input_pointer_set(input, input->cursor_surface,
@@ -206,7 +208,7 @@ _ecore_wl_input_cursor_update(void *data)
                           cursor_image->width, cursor_image->height);
         wl_surface_commit(input->cursor_surface);
 
-        if (!input->cursor_frame_cb)
+        if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
           _ecore_wl_input_cb_pointer_frame(input, NULL, 0);
      }
 
@@ -515,7 +517,7 @@ _ecore_wl_input_cb_pointer_frame(void *data, struct 
wl_callback *callback, unsig
         return;
      }
 
-   if (!input->cursor_frame_cb)
+   if ((input->cursor->image_count > 1) && (!input->cursor_frame_cb))
      {
         input->cursor_frame_cb = wl_surface_frame(input->cursor_surface);
         wl_callback_add_listener(input->cursor_frame_cb, 

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk

Reply via email to