Elm: Fix ticket #1245. Mouse cursor does not change before window

resizing.

Previously, we only changed the mouse cursor when the border frame was
actually clicked. Now we can change it when the mouse moves over the
border/frame areas (like in X11). This adds a callback from the edc to
know when and where the mouse moves (with respect to the frame border
only). (IE: When the user moves the mouse over the bottom portion of
the border, the edc will let us know and we can change pointer
accordingly).




SVN revision: 74925
This commit is contained in:
Christopher Michael 2012-08-06 12:05:53 +00:00
parent 190a171f87
commit 7287ff954b
1 changed files with 41 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#include <Elementary.h>
#include <Elementary_Cursor.h>
#include "elm_priv.h"
static const char WIN_SMART_NAME[] = "elm_win";
@ -1801,6 +1802,43 @@ _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_resize_show(void *data,
Evas_Object *obj __UNUSED__,
const char *sig __UNUSED__,
const char *source)
{
Elm_Win_Smart_Data *sd;
if (!(sd = data)) return;
if (sd->resizing) return;
#ifdef HAVE_ELEMENTARY_WAYLAND
if (!strcmp(source, "elm.event.resize.t"))
ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_TOP_SIDE);
else if (!strcmp(source, "elm.event.resize.b"))
ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_BOTTOM_SIDE);
else if (!strcmp(source, "elm.event.resize.l"))
ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_LEFT_SIDE);
else if (!strcmp(source, "elm.event.resize.r"))
ecore_wl_window_cursor_from_name_set(sd->wl.win, ELM_CURSOR_RIGHT_SIDE);
else if (!strcmp(source, "elm.event.resize.tl"))
ecore_wl_window_cursor_from_name_set(sd->wl.win,
ELM_CURSOR_TOP_LEFT_CORNER);
else if (!strcmp(source, "elm.event.resize.tr"))
ecore_wl_window_cursor_from_name_set(sd->wl.win,
ELM_CURSOR_TOP_RIGHT_CORNER);
else if (!strcmp(source, "elm.event.resize.bl"))
ecore_wl_window_cursor_from_name_set(sd->wl.win,
ELM_CURSOR_BOTTOM_LEFT_CORNER);
else if (!strcmp(source, "elm.event.resize.br"))
ecore_wl_window_cursor_from_name_set(sd->wl.win,
ELM_CURSOR_BOTTOM_RIGHT_CORNER);
else
ecore_wl_window_cursor_default_restore(sd->wl.win);
#endif
}
static void
_elm_win_frame_cb_resize_start(void *data,
Evas_Object *obj __UNUSED__,
@ -1814,8 +1852,6 @@ _elm_win_frame_cb_resize_start(void *data,
sd->resizing = EINA_TRUE;
/* FIXME: Change mouse pointer */
if (!strcmp(source, "elm.event.resize.t"))
sd->resize_location = 1;
else if (!strcmp(source, "elm.event.resize.b"))
@ -1895,6 +1931,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, sd);
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,resize,show", "*",
_elm_win_frame_cb_resize_show, sd);
edje_object_signal_callback_add
(sd->frame_obj, "elm,action,resize,start", "*",
_elm_win_frame_cb_resize_start, sd);