devilhorns pushed a commit to branch master.

commit eb70a093b362676af755376e6e7e78af6315815f
Author: Chris Michael <[email protected]>
Date:   Wed Aug 28 14:24:49 2013 +0100

    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 <[email protected]>
---
 src/lib/elm_win.c | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 0c7c83b..0cef40d 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -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
 {
@@ -2436,6 +2461,9 @@ _elm_win_frame_add(Elm_Win_Smart_Data *sd,
      (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);
    edje_object_signal_callback_add
@@ -2485,6 +2513,9 @@ _elm_win_frame_del(Elm_Win_Smart_Data *sd)
           (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);
         edje_object_signal_callback_del

-- 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk

Reply via email to