fix pointer offset fpor older themes

fixes T8622

so due rto optimizations in edje it no longer moves/resizes invsible
parts, so swallow a rect and it wont have moved if it is not visible
thus tracking its geometry by getting the geometry of the swallowed
part only works if its visible, so get the part geom from edje instead
which has to give the calculated geom.
This commit is contained in:
Carsten Haitzler 2020-04-01 20:12:15 +01:00
parent 43ed98beff
commit 64f87877a6
1 changed files with 8 additions and 6 deletions

View File

@ -225,8 +225,8 @@ _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;
evas_object_geometry_get(ptr->buffer_o_hot,
&x, &y, NULL, NULL);
edje_object_part_geometry_get(ptr->o_ptr, "e.swallow.hotspot",
&x, &y, NULL, NULL);
_e_pointer_hot_update(ptr, x, y);
}
@ -237,8 +237,8 @@ _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;
evas_object_geometry_get(ptr->buffer_o_hot,
&x, &y, NULL, NULL);
edje_object_part_geometry_get(ptr->o_ptr, "e.swallow.hotspot",
&x, &y, NULL, NULL);
_e_pointer_hot_update(ptr, x, y);
}
@ -477,8 +477,8 @@ _e_pointer_type_set(E_Pointer *ptr, const char *type)
_e_pointer_x11_setup(ptr, cursor);
if (!cursor[0]) return;
evas_object_geometry_get(ptr->buffer_o_hot,
&x, &y, NULL, NULL);
edje_object_part_geometry_get(ptr->o_ptr, "e.swallow.hotspot",
&x, &y, NULL, NULL);
_e_pointer_hot_update(ptr, x, y);
if (ptr->canvas)
@ -783,6 +783,7 @@ e_pointer_idler_before(void)
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Cursor cur;
printf("update cursor hot %i %i\n", ptr->hot.x, ptr->hot.y);
cur = ecore_x_cursor_new(ptr->win, ptr->pixels, ptr->w,
ptr->h, ptr->hot.x, ptr->hot.y);
ecore_x_window_cursor_set(ptr->win, cur);
@ -830,6 +831,7 @@ e_pointer_object_set(E_Pointer *ptr, Evas_Object *obj, int x, int y)
else if ((o != ptr->o_ptr) || (x != px) || (y != py))
{
ecore_evas_cursor_unset(ptr->ee);
printf("ecore_evas_obj ptr hot %i %i\n", ptr->hot.x, ptr->hot.y);
ecore_evas_object_cursor_set(ptr->ee, ptr->o_ptr, E_LAYER_MAX - 1, ptr->hot.x, ptr->hot.y);
evas_object_show(ptr->o_ptr);
}