raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=f190df472a713e4ee1e3e6fe8f3450d1fef7923f

commit f190df472a713e4ee1e3e6fe8f3450d1fef7923f
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Nov 25 20:19:35 2020 +0000

    e pointer limit hot cursors hot spots to bounds and track hot geom
    
    found hot spot was not being tracked right as callbacks for obj moves
    arent in sync with getting part geom - so get geom of the swallowed
    obj itself. then hot geom is right and the hot limitign ensures a bad
    theme design with out of bound hot geom wont lead to bland cursors
    
    @fix
---
 src/bin/e_pointer.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c
index 82f928192..f0ce9adee 100644
--- a/src/bin/e_pointer.c
+++ b/src/bin/e_pointer.c
@@ -225,8 +225,7 @@ _e_pointer_cb_hot_move(void *data, Evas *evas EINA_UNUSED, 
Evas_Object *obj EINA
 
    if (!ptr->e_cursor) return;
    if (!evas_object_visible_get(ptr->o_ptr)) return;
-   edje_object_part_geometry_get(ptr->o_ptr, "e.swallow.hotspot",
-                                 &x, &y, NULL, NULL);
+   evas_object_geometry_get(ptr->o_hot, &x, &y, NULL, NULL);
    _e_pointer_hot_update(ptr, x, y);
 }
 
@@ -237,8 +236,7 @@ _e_pointer_cb_hot_show(void *data, Evas *evas EINA_UNUSED, 
Evas_Object *obj EINA
    int x = 0, y = 0;
 
    if (!ptr->e_cursor) return;
-   edje_object_part_geometry_get(ptr->o_ptr, "e.swallow.hotspot",
-                                 &x, &y, NULL, NULL);
+   evas_object_geometry_get(ptr->o_hot, &x, &y, NULL, NULL);
    _e_pointer_hot_update(ptr, x, y);
 }
 
@@ -792,9 +790,15 @@ e_pointer_idler_before(void)
                {
 #ifndef HAVE_WAYLAND_ONLY
                   Ecore_X_Cursor cur;
-
-                  cur = ecore_x_cursor_new(ptr->win, ptr->pixels, ptr->w,
-                                           ptr->h, ptr->hot.x, ptr->hot.y);
+                  int hotx = ptr->hot.x;
+                  int hoty = ptr->hot.y;
+
+                  if      (hotx < 0)       hotx = 0;
+                  else if (hotx >= ptr->w) hotx = ptr->w - 1;
+                  if      (hoty < 0)       hoty = 0;
+                  else if (hoty >= ptr->h) hoty = ptr->h - 1;
+                  cur = ecore_x_cursor_new(ptr->win, ptr->pixels,
+                                           ptr->w, ptr->h, hotx, hoty);
                   ecore_x_window_cursor_set(ptr->win, cur);
                   ecore_x_cursor_free(cur);
 #endif

-- 


Reply via email to