e_pointer: fix cursor position when calling e_pointer_object_set() 80/85480/5
authorDuna Oh <duna.oh@samsung.com>
Thu, 25 Aug 2016 08:48:47 +0000 (17:48 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 29 Aug 2016 03:45:50 +0000 (20:45 -0700)
1. _e_pointer_move() do nothing because ptr->o_ptr is NULL.
2. the arguments x, y of e_pointer_object_set is used for hot spot, not cursor position.
3. rename _e_pointer_move() to _e_pointer_position_update()

Change-Id: If78f507981cd3b3c495aeef469bd2cdb2d0d3dd9
Signed-off-by: Duna Oh <duna.oh@samsung.com>
src/bin/e_comp_wl_input.c
src/bin/e_pointer.c

index 4405235..f54c329 100644 (file)
@@ -34,7 +34,7 @@ _e_comp_wl_input_pointer_map(struct wl_resource *resource)
    if (!(ec = wl_resource_get_user_data(resource))) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
 
-   e_pointer_object_set(e_comp->pointer, ec->frame, ec->x, ec->y);
+   e_pointer_object_set(e_comp->pointer, ec->frame, 0, 0);
 }
 
 static void
@@ -87,10 +87,6 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
         ec->re_manage = 1;
         ec->ignored = 0;
 
-        // TODO: this should be transformed to the local coordinate of pointer surface
-        ec->x = x;
-        ec->y = y;
-
         ec->lock_focus_out = ec->layer_block = ec->visible = 1;
         if (!e_config->show_cursor)  ec->override = 1;
         ec->icccm.title = eina_stringshare_add("Cursor");
index 4d125ed..20ad724 100644 (file)
@@ -6,7 +6,7 @@ static Eina_Bool _initted = EINA_FALSE;
 
 /* move the cursor image with the calcaultion of the hot spot */
 static void
-_e_pointer_move(E_Pointer *ptr, int x, int y)
+_e_pointer_position_update(E_Pointer *ptr)
 {
    int nx, ny;
 
@@ -69,7 +69,7 @@ _e_pointer_rotation_apply(E_Pointer *ptr)
      {
         evas_object_map_set(ec->frame, NULL);
         evas_object_map_enable_set(ec->frame, EINA_FALSE);
-        _e_pointer_move(ptr, x, y);
+        _e_pointer_position_update(ptr);
         return;
      }
 
@@ -245,15 +245,16 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y)
              ec->override = 0; /* do not ignore the cursor_ec to set the image object */
           }
 
+        ptr->o_ptr = obj;
+
         /* apply the cursor obj rotation */
         _e_pointer_rotation_apply(ptr);
 
         /* move the pointer to the current position */
-        _e_pointer_move(ptr, ptr->x, ptr->y);
+        _e_pointer_position_update(ptr);
 
         /* show cursor object */
         evas_object_show(obj);
-        ptr->o_ptr = obj;
      }
 }
 
@@ -273,7 +274,7 @@ e_pointer_touch_move(E_Pointer *ptr, int x, int y)
    if (ptr->device != E_POINTER_TOUCH) ptr->device = E_POINTER_TOUCH;
 
    _e_pointer_rotation_apply(ptr);
-   _e_pointer_move(ptr, ptr->x, ptr->y);
+   _e_pointer_position_update(ptr);
 }
 
 EINTERN void
@@ -292,7 +293,7 @@ e_pointer_mouse_move(E_Pointer *ptr, int x, int y)
    if (ptr->device != E_POINTER_MOUSE) ptr->device = E_POINTER_MOUSE;
 
    _e_pointer_rotation_apply(ptr);
-   _e_pointer_move(ptr, ptr->x, ptr->y);
+   _e_pointer_position_update(ptr);
 }
 
 E_API void
@@ -321,7 +322,7 @@ e_pointer_rotation_set(E_Pointer *ptr, int rotation)
    ptr->rotation = rotation;
 
    _e_pointer_rotation_apply(ptr);
-   _e_pointer_move(ptr, ptr->x, ptr->y);
+   _e_pointer_position_update(ptr);
 }
 
 E_API void