aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/lib/elm_win.c
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-08-06 12:05:53 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-08-06 12:05:53 +0000
commit7287ff954b5f4104de268a3672e3843802194981 (patch)
tree82195ff8a3b03c5dc7d69eec363f9241f795e003 /legacy/elementary/src/lib/elm_win.c
parentelm elm_win.c: Mark __UNUSED__ for unused parameters. (diff)
downloadefl-7287ff954b5f4104de268a3672e3843802194981.tar.gz
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
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
-rw-r--r--legacy/elementary/src/lib/elm_win.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index bdfb70a7b6..005afcb393 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -1,4 +1,5 @@
#include <Elementary.h>
+#include <Elementary_Cursor.h>
#include "elm_priv.h"
static const char WIN_SMART_NAME[] = "elm_win";
@@ -1802,6 +1803,43 @@ _elm_win_frame_cb_move_start(void *data,
}
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__,
const char *sig __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"))
@@ -1896,6 +1932,9 @@ _elm_win_frame_add(Elm_Win_Smart_Data *sd,
(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);
edje_object_signal_callback_add