forked from enlightenment/efl
elementary: Ensure pointer hotspot update and reduce duplicated code
When we mouse_in on a window, the cursor hotspot may need updating for the new pointer image, so utilize an existing function we already have which will set the pointer image and calculate updated hotspot. This patch also uses the same function call in _elm_win_frame_cb_move_stop in order to reduce duplication. ref T4987 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
d485a116d3
commit
4697d0c2b3
|
@ -952,14 +952,11 @@ _elm_win_mouse_in(Ecore_Evas *ee)
|
||||||
#ifdef HAVE_ELEMENTARY_WL2
|
#ifdef HAVE_ELEMENTARY_WL2
|
||||||
if ((sd->wl.win) && (sd->pointer.ee))
|
if ((sd->wl.win) && (sd->pointer.ee))
|
||||||
{
|
{
|
||||||
_elm_theme_object_set(sd->obj, sd->pointer.obj,
|
|
||||||
"pointer", "base", "default");
|
|
||||||
|
|
||||||
sd->pointer.visible = EINA_TRUE;
|
sd->pointer.visible = EINA_TRUE;
|
||||||
ecore_evas_show(sd->pointer.ee);
|
ecore_evas_show(sd->pointer.ee);
|
||||||
sd->pointer.surf = ecore_wl2_window_surface_get(sd->pointer.win);
|
sd->pointer.surf = ecore_wl2_window_surface_get(sd->pointer.win);
|
||||||
ecore_wl2_window_pointer_set(sd->wl.win, sd->pointer.surf,
|
|
||||||
sd->pointer.hot_x, sd->pointer.hot_y);
|
_elm_win_wl_cursor_set(sd->obj, NULL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -3947,13 +3944,7 @@ _elm_win_frame_cb_move_stop(void *data,
|
||||||
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
ELM_WIN_DATA_GET_OR_RETURN(data, sd);
|
||||||
|
|
||||||
#ifdef HAVE_ELEMENTARY_WL2
|
#ifdef HAVE_ELEMENTARY_WL2
|
||||||
if (sd->pointer.obj)
|
_elm_win_wl_cursor_set(sd->obj, NULL);
|
||||||
_elm_theme_object_set(sd->obj, sd->pointer.obj,
|
|
||||||
"pointer", "base", "default");
|
|
||||||
|
|
||||||
if ((sd->wl.win) && (sd->pointer.surf) && (sd->pointer.visible))
|
|
||||||
ecore_wl2_window_pointer_set(sd->wl.win, sd->pointer.surf,
|
|
||||||
sd->pointer.hot_x, sd->pointer.hot_y);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue