Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_pointer.c 


Log Message:
Don't change pointer if it is equal.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_pointer.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- e_pointer.c 9 Oct 2005 18:02:17 -0000       1.14
+++ e_pointer.c 9 Oct 2005 18:11:10 -0000       1.15
@@ -22,7 +22,7 @@
 
 static void _e_pointer_cb_move(void *data, Evas *e __UNUSED__, Evas_Object 
*obj __UNUSED__, void *event_info);
 static void _e_pointer_free(E_Pointer *p);
-static int  _e_pointer_type_set(E_Pointer *p);
+static int  _e_pointer_type_set(E_Pointer *p, const char *type);
 
 /* externally accessible functions */
 E_Pointer *
@@ -171,20 +171,20 @@
 {
    E_Pointer_Stack *stack;
 
-   if (p->type) free(p->type);
-   p->type = strdup(type);
-   p->obj = obj;
-
-   if (!_e_pointer_type_set(p))
+   if (!_e_pointer_type_set(p, type))
      {
        p->e_cursor = !p->e_cursor;
-       if (!_e_pointer_type_set(p))
+       if (!_e_pointer_type_set(p, type))
          {
             printf("BUG: Can't set cursor!\n");
             return;
          }
      }
 
+   if (p->type) free(p->type);
+   p->type = strdup(type);
+   p->obj = obj;
+
    stack = E_NEW(E_Pointer_Stack, 1);
    if (stack)
      {
@@ -233,21 +233,21 @@
        return;
      }
 
-   if (p->type) free(p->type);
-   p->type = strdup(stack->type);
-   p->obj = stack->obj;
-
    p->e_cursor = stack->e_cursor;
-   if (!_e_pointer_type_set(p))
+   if (!_e_pointer_type_set(p, stack->type))
      {
        p->e_cursor = !p->e_cursor;
-       if (!_e_pointer_type_set(p))
+       if (!_e_pointer_type_set(p, stack->type))
          {
             printf("BUG: Can't set cursor!\n");
             return;
          }
      }
 
+   if (p->type) free(p->type);
+   p->type = strdup(stack->type);
+   p->obj = stack->obj;
+
    /* try the default cursor next time */
    p->e_cursor = e_config->use_e_cursor;
 }
@@ -324,8 +324,11 @@
 }
 
 static int
-_e_pointer_type_set(E_Pointer *p)
+_e_pointer_type_set(E_Pointer *p, const char *type)
 {
+   /* Check if this pointer is already set */
+   if ((p->type) && (!strcmp(p->type, type))) return 1;
+
    if (p->e_cursor)
      {
        Evas_Object *o;




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to