forked from enlightenment/efl
ecore/wayland: Consider the framespace offset for the pointer object.
We have to subtract the framespace offset from the current set pointer object, otherwise it will have that offset added to it when evas_object_move() is done on it. This happens because the pointer object has no parent, and is not marked with the flag "is_frame". SVN revision: 78972
This commit is contained in:
parent
76f067b9fb
commit
508585c48b
|
@ -2486,23 +2486,25 @@ _ecore_evas_mouse_move_process(Ecore_Evas *ee, int x, int y, unsigned int timest
|
|||
ee->mouse.y = y;
|
||||
if (ee->prop.cursor.object)
|
||||
{
|
||||
int fx, fy;
|
||||
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
|
||||
evas_object_show(ee->prop.cursor.object);
|
||||
if (ee->rotation == 0)
|
||||
evas_object_move(ee->prop.cursor.object,
|
||||
x - ee->prop.cursor.hot.x,
|
||||
y - ee->prop.cursor.hot.y);
|
||||
x - fx - ee->prop.cursor.hot.x,
|
||||
y - fy - ee->prop.cursor.hot.y);
|
||||
else if (ee->rotation == 90)
|
||||
evas_object_move(ee->prop.cursor.object,
|
||||
ee->h - y - 1 - ee->prop.cursor.hot.x,
|
||||
x - ee->prop.cursor.hot.y);
|
||||
ee->h - y - fx - 1 - ee->prop.cursor.hot.x,
|
||||
x - fy - ee->prop.cursor.hot.y);
|
||||
else if (ee->rotation == 180)
|
||||
evas_object_move(ee->prop.cursor.object,
|
||||
ee->w - x - 1 - ee->prop.cursor.hot.x,
|
||||
ee->h - y - 1 - ee->prop.cursor.hot.y);
|
||||
ee->w - x - fx - 1 - ee->prop.cursor.hot.x,
|
||||
ee->h - y - fy - 1 - ee->prop.cursor.hot.y);
|
||||
else if (ee->rotation == 270)
|
||||
evas_object_move(ee->prop.cursor.object,
|
||||
y - ee->prop.cursor.hot.x,
|
||||
ee->w - x - 1 - ee->prop.cursor.hot.y);
|
||||
y - fx - ee->prop.cursor.hot.x,
|
||||
ee->w - x - fy - 1 - ee->prop.cursor.hot.y);
|
||||
}
|
||||
if (ee->rotation == 0)
|
||||
evas_event_feed_mouse_move(ee->evas, x, y, timestamp, NULL);
|
||||
|
|
|
@ -592,7 +592,7 @@ _ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj _
|
|||
void
|
||||
_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
||||
{
|
||||
int x, y;
|
||||
int x, y, fx, fy;
|
||||
|
||||
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
||||
|
||||
|
@ -614,10 +614,11 @@ _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int la
|
|||
ecore_wl_window_pointer_set(ee->engine.wl.win, NULL, 0, 0);
|
||||
|
||||
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
||||
evas_output_framespace_get(ee->evas, &fx, &fy, NULL, NULL);
|
||||
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
||||
evas_object_move(ee->prop.cursor.object,
|
||||
x - ee->prop.cursor.hot.x,
|
||||
y - ee->prop.cursor.hot.y);
|
||||
x - fx - ee->prop.cursor.hot.x,
|
||||
y - fy - ee->prop.cursor.hot.y);
|
||||
evas_object_pass_events_set(ee->prop.cursor.object, 1);
|
||||
if (evas_pointer_inside_get(ee->evas))
|
||||
evas_object_show(ee->prop.cursor.object);
|
||||
|
|
|
@ -86,7 +86,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
|
|||
_ecore_evas_wl_common_size_max_set,
|
||||
_ecore_evas_wl_common_size_base_set,
|
||||
_ecore_evas_wl_common_size_step_set,
|
||||
_ecore_evas_wl_common_object_cursor_set, // object_cursor_set
|
||||
_ecore_evas_wl_common_object_cursor_set,
|
||||
_ecore_evas_wl_common_layer_set,
|
||||
NULL, // focus set
|
||||
_ecore_evas_wl_common_iconified_set,
|
||||
|
|
Loading…
Reference in New Issue