discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=d0f45a48a4dbe891aece36fbfdd616d786520d8d

commit d0f45a48a4dbe891aece36fbfdd616d786520d8d
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Jun 9 20:18:20 2017 -0400

    use event_grabber to simulate explicit grab during window move/resize 
actions
    
    this grabs the client's frame as well as any existing edge objects during 
drags
    
    ref T5552
---
 src/bin/e_client.c      | 23 +++++++++++++++++++++++
 src/bin/e_comp_canvas.c | 31 +++++++++++++++++++++++++++++++
 src/bin/e_comp_canvas.h |  2 +-
 3 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index c11924e60..75c683d66 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -42,6 +42,7 @@ static Eina_List *focus_stack = NULL;
 static Eina_List *raise_stack = NULL;
 
 static Eina_Bool comp_grabbed = EINA_FALSE;
+static Evas_Object *action_rect;
 
 static Eina_List *handlers = NULL;
 //static Eina_Bool client_grabbed = EINA_FALSE;
@@ -364,6 +365,7 @@ _e_client_action_input_win_del(void)
    if (!comp_grabbed) return 0;
 
    comp_grabbed = 0;
+   E_FREE_FUNC(action_rect, evas_object_del);
    e_comp_ungrab_input(1, 1);
    return 1;
 }
@@ -746,6 +748,25 @@ _e_client_action_input_win_new(void)
 }
 
 static void
+_e_client_action_event_grabber_mouse_up(void *data EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   if (action_client && action_client->moving)
+     e_client_act_move_end(action_client, NULL);
+}
+
+static void
+_e_client_action_event_grabber_init(E_Client *ec)
+{
+   action_rect = e_comp_canvas_event_grabber_add();
+   evas_object_event_callback_add(action_rect, EVAS_CALLBACK_MOUSE_UP, 
_e_client_action_event_grabber_mouse_up, NULL);
+   evas_object_smart_member_add(ec->frame, action_rect);
+   evas_object_resize(action_rect, e_comp->w, e_comp->h);
+   evas_object_layer_set(action_rect, EVAS_LAYER_MAX - 100);
+   evas_object_show(action_rect);
+
+}
+
+static void
 _e_client_action_init(E_Client *ec)
 {
    action_orig.x = ec->x;
@@ -821,6 +842,7 @@ _e_client_move_begin(E_Client *ec)
         return 0;
      }
    E_FREE_FUNC(ec->raise_timer, ecore_timer_del);
+   _e_client_action_event_grabber_init(ec);
    return 1;
 }
 
@@ -5147,6 +5169,7 @@ e_client_resize_begin(E_Client *ec)
         return EINA_FALSE;
      }
    E_FREE_FUNC(ec->raise_timer, ecore_timer_del);
+   _e_client_action_event_grabber_init(ec);
    return EINA_TRUE;
 error:
    ec->resize_mode = E_POINTER_RESIZE_NONE;
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index 654aa9851..41504f6e3 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -848,6 +848,37 @@ e_comp_canvas_feed_mouse_up(unsigned int activate_time)
      }
 }
 
+E_API Evas_Object *
+e_comp_canvas_event_grabber_add(void)
+{
+   E_Zone *zone;
+   Eina_List *l;
+   Evas_Object *o;
+
+   o = evas_object_event_grabber_add(e_comp->evas);
+   EINA_LIST_FOREACH(e_comp->zones, l, zone)
+     {
+#define EDGE_ADD(E) \
+        if (zone->E) \
+          evas_object_smart_member_add(zone->E, o)
+
+        EDGE_ADD(edge.top);
+        EDGE_ADD(edge.right);
+        EDGE_ADD(edge.bottom);
+        EDGE_ADD(edge.left);
+
+        EDGE_ADD(corner.left_top);
+        EDGE_ADD(corner.right_top);
+        EDGE_ADD(corner.top_left);
+        EDGE_ADD(corner.top_right);
+        EDGE_ADD(corner.left_bottom);
+        EDGE_ADD(corner.right_bottom);
+        EDGE_ADD(corner.bottom_left);
+        EDGE_ADD(corner.bottom_right);
+     }
+   return o;
+}
+
 EINTERN void
 e_comp_canvas_intercept(void)
 {
diff --git a/src/bin/e_comp_canvas.h b/src/bin/e_comp_canvas.h
index 911b8d8e6..b70481bf4 100644
--- a/src/bin/e_comp_canvas.h
+++ b/src/bin/e_comp_canvas.h
@@ -28,7 +28,7 @@ E_API E_Layer e_comp_canvas_client_layer_map_nearest(int 
layer);
 E_API void e_comp_canvas_keys_grab(void);
 E_API void e_comp_canvas_keys_ungrab(void);
 E_API void e_comp_canvas_feed_mouse_up(unsigned int activate_time);
-
+E_API Evas_Object *e_comp_canvas_event_grabber_add(void);
 EINTERN void e_comp_canvas_intercept(void);
 
 /* the following functions are used for adjusting root window coordinates

-- 


Reply via email to