Fix mike's "move pointer" problem with elm apps inside wayland-only.

On a move start signal, set the mouse cursor to "move".
Add hook for "move stop" to unset cursor.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2013-08-28 14:24:49 +01:00
parent ec474f513d
commit 01c42920f2
1 changed files with 32 additions and 1 deletions

View File

@ -2136,11 +2136,21 @@ static void
_elm_win_frame_cb_move_start(void *data,
Evas_Object *obj __UNUSED__,
const char *sig __UNUSED__,
const char *source __UNUSED__)
const char *source)
{
ELM_WIN_DATA_GET(data, sd);
if (!sd) return;
#ifdef HAVE_ELEMENTARY_WAYLAND
if (!strcmp(source, "elm"))
ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_HAND1);
else
ecore_wl_window_cursor_default_restore(sd->wl.win);
#else
(void)source;
#endif
/* FIXME: Change mouse pointer */
/* NB: Wayland handles moving surfaces by itself so we cannot
@ -2152,6 +2162,21 @@ _elm_win_frame_cb_move_start(void *data,
ecore_evas_wayland_move(sd->ee, sd->screen.x, sd->screen.y);
}
static void
_elm_win_frame_cb_move_stop(void *data,
Evas_Object *obj __UNUSED__,
const char *sig __UNUSED__,
const char *source __UNUSED__)
{
ELM_WIN_DATA_GET(data, sd);
if (!sd) return;
#ifdef HAVE_ELEMENTARY_WAYLAND
ecore_wl_window_cursor_default_restore(sd->wl.win);
#endif
}
#ifdef HAVE_ELEMENTARY_WAYLAND
struct _resize_info
{
@ -2435,6 +2460,9 @@ _elm_win_frame_add(Elm_Win_Smart_Data *sd,
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,move,start", "elm",
_elm_win_frame_cb_move_start, obj);
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,move,stop", "elm",
_elm_win_frame_cb_move_stop, obj);
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,resize,show", "*",
_elm_win_frame_cb_resize_show, obj);
@ -2484,6 +2512,9 @@ _elm_win_frame_del(Elm_Win_Smart_Data *sd)
edje_object_signal_callback_del
(sd->frame_obj, "elm,action,move,start", "elm",
_elm_win_frame_cb_move_start);
edje_object_signal_callback_del
(sd->frame_obj, "elm,action,move,stop", "elm",
_elm_win_frame_cb_move_stop);
edje_object_signal_callback_del
(sd->frame_obj, "elm,action,resize,show", "*",
_elm_win_frame_cb_resize_show);