discomfitor pushed a commit to branch master.

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

commit 442d63d8d6ec2e3623f377945da36eeba0885c50
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Wed Aug 12 15:39:42 2015 -0400

    track button mask for all drags, only end drag when mask has depopulated
    
    previously, beginning a drag with the left button, then pressing and
    releasing another button would result in the drag terminating without
    the original button being released
---
 src/bin/e_client.c                   | 1 +
 src/bin/e_comp_wl_data.c             | 1 +
 src/bin/e_dnd.c                      | 5 +++++
 src/bin/e_dnd.h                      | 1 +
 src/bin/e_fm.c                       | 3 ++-
 src/bin/e_gadcon.c                   | 1 +
 src/bin/e_int_menus.c                | 1 +
 src/modules/gadman/e_mod_gadman.c    | 1 +
 src/modules/ibar/e_mod_main.c        | 1 +
 src/modules/ibox/e_mod_main.c        | 1 +
 src/modules/pager/e_mod_main.c       | 2 ++
 src/modules/pager_plain/e_mod_main.c | 2 ++
 src/modules/xwayland/dnd.c           | 1 +
 13 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 20fa998..96103f9 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -3015,6 +3015,7 @@ e_client_mouse_move(E_Client *ec, Evas_Point *output)
                                                 drag_types, 1, ec, -1,
                                                 NULL,
                                                 _e_client_cb_drag_finished);
+                       client_drag->button_mask = 
evas_pointer_button_down_mask_get(e_comp->evas);
                        e_drag_resize(client_drag, w, h);
 
                        o = e_client_icon_add(ec, client_drag->evas);
diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c
index 3c2ad61..1a92288 100644
--- a/src/bin/e_comp_wl_data.c
+++ b/src/bin/e_comp_wl_data.c
@@ -364,6 +364,7 @@ _e_comp_wl_data_device_cb_drag_start(struct wl_client 
*client, struct wl_resourc
    evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
    e_comp->wl_comp_data->drag = e_drag_new(x, y,
                                            NULL, 0, NULL, 0, NULL, 
_e_comp_wl_data_device_drag_finished);
+   e_comp->wl_comp_data->drag->button_mask = 
evas_pointer_button_down_mask_get(e_comp->evas);
    if (ec)
      e_drag_object_set(e_comp->wl_comp_data->drag, ec->frame);
    e_drag_start(e_comp->wl_comp_data->drag, x, y);
diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c
index ea74c1c..7a2324b 100644
--- a/src/bin/e_dnd.c
+++ b/src/bin/e_dnd.c
@@ -1197,6 +1197,11 @@ _e_dnd_cb_mouse_up(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event)
 
    if (ev->window != _drag_win) return ECORE_CALLBACK_PASS_ON;
 
+   if (_drag_current && _drag_current->button_mask)
+     {
+        _drag_current->button_mask &= ~(1 << (ev->buttons - 1));
+        if (_drag_current->button_mask) return ECORE_CALLBACK_RENEW;
+     }
    _e_drag_end(ev->x, ev->y);
 
    return ECORE_CALLBACK_PASS_ON;
diff --git a/src/bin/e_dnd.h b/src/bin/e_dnd.h
index 3baa9b0..a02d4ab 100644
--- a/src/bin/e_dnd.h
+++ b/src/bin/e_dnd.h
@@ -44,6 +44,7 @@ struct _E_Drag
 
    int                x, y, w, h;
    int                dx, dy;
+   unsigned int       button_mask;
 
    E_Layer            layer;
    unsigned char      visible : 1;
diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c
index ea820e3..cc89a33 100644
--- a/src/bin/e_fm.c
+++ b/src/bin/e_fm.c
@@ -7562,7 +7562,7 @@ _e_fm2_cb_icon_mouse_out(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_
 }
 
 static void
-_e_fm2_cb_icon_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event_info)
+_e_fm2_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, 
void *event_info)
 {
    Evas_Event_Mouse_Move *ev;
    E_Fm2_Icon *ic;
@@ -7699,6 +7699,7 @@ _e_fm2_cb_icon_mouse_move(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EINA
 
              d = e_drag_new(0, 0, drag_types, 1,
                             sel, sel_length, NULL, _e_fm2_cb_drag_finished);
+             d->button_mask = evas_pointer_button_down_mask_get(e);
              if (layout)
                d->x = ic->sd->x, d->y = ic->sd->y;
              else
diff --git a/src/bin/e_gadcon.c b/src/bin/e_gadcon.c
index 9ec7d79..cf49ca8 100644
--- a/src/bin/e_gadcon.c
+++ b/src/bin/e_gadcon.c
@@ -2302,6 +2302,7 @@ _e_gadcon_client_drag_begin(E_Gadcon_Client *gcc, int x, 
int y)
                                       drag_types, 1, gcc, -1, NULL,
                                       e_gadcon_drag_finished_cb);
    if (!drag) return;
+   drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
 
    o = gcc->client_class->func.icon((E_Gadcon_Client_Class *)gcc->client_class,
                                     e_drag_evas_get(drag));
diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c
index 1bfb848..7c50a2c 100644
--- a/src/bin/e_int_menus.c
+++ b/src/bin/e_int_menus.c
@@ -1009,6 +1009,7 @@ _e_int_menus_apps_drag(void *data, E_Menu *m EINA_UNUSED, 
E_Menu_Item *mi)
         efreet_desktop_ref(desktop);
         drag = e_drag_new(x, y, drag_types, 1, desktop, -1,
                           NULL, NULL);
+        drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
 
         size = MIN(w, h);
         o = e_util_desktop_icon_add(desktop, size, e_drag_evas_get(drag));
diff --git a/src/modules/gadman/e_mod_gadman.c 
b/src/modules/gadman/e_mod_gadman.c
index 8b3547c..4783756 100644
--- a/src/modules/gadman/e_mod_gadman.c
+++ b/src/modules/gadman/e_mod_gadman.c
@@ -1536,6 +1536,7 @@ on_move(void *data, Evas_Object *o EINA_UNUSED, const 
char *em EINA_UNUSED, cons
                      drag_types, 1, drag_gcc, -1, NULL,
                      e_gadcon_drag_finished_cb);
    if (!drag) return;
+   drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
 
    o = drag_gcc->client_class->func.icon((E_Gadcon_Client_Class 
*)drag_gcc->client_class,
                                     e_drag_evas_get(drag));
diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c
index 4f69b81..8022d85 100644
--- a/src/modules/ibar/e_mod_main.c
+++ b/src/modules/ibar/e_mod_main.c
@@ -1834,6 +1834,7 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_
         evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
         d = e_drag_new(x, y, drag_types, 1,
                        ic->app, -1, NULL, _ibar_cb_drag_finished);
+        d->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
         efreet_desktop_ref(ic->app);
         size = MAX(w, h);
         o = e_util_desktop_icon_add(ic->app, size, e_drag_evas_get(d));
diff --git a/src/modules/ibox/e_mod_main.c b/src/modules/ibox/e_mod_main.c
index 5314d5c..9f9eaf0 100644
--- a/src/modules/ibox/e_mod_main.c
+++ b/src/modules/ibox/e_mod_main.c
@@ -783,6 +783,7 @@ _ibox_cb_icon_mouse_move(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_
              evas_object_geometry_get(ic->o_icon, &x, &y, &w, &h);
              d = e_drag_new(x, y, drag_types, 1,
                             ic->client, -1, NULL, _ibox_cb_drag_finished);
+             d->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
              o = e_client_icon_add(ic->client, e_drag_evas_get(d));
              e_drag_object_set(d, o);
 
diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c
index 6f99346..f6db105 100644
--- a/src/modules/pager/e_mod_main.c
+++ b/src/modules/pager/e_mod_main.c
@@ -1188,6 +1188,7 @@ _pager_window_cb_mouse_move(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EI
    drag = e_drag_new(x, y, drag_types, 2, pw->desk->pager, -1,
                      _pager_window_cb_drag_convert,
                      _pager_window_cb_drag_finished);
+   drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
 
    /* this is independent of the original mirror */
    o = e_deskmirror_mirror_copy(pw->o_mirror);
@@ -1587,6 +1588,7 @@ _pager_desk_cb_mouse_move(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EINA
         evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
         drag = e_drag_new(x, y, drag_types, 1, pd, -1,
                           NULL, _pager_desk_cb_drag_finished);
+        drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
         
         /* redraw the desktop theme above */
         o = e_comp_object_util_mirror_add(pd->o_layout);
diff --git a/src/modules/pager_plain/e_mod_main.c 
b/src/modules/pager_plain/e_mod_main.c
index 43940f3..55f3999 100644
--- a/src/modules/pager_plain/e_mod_main.c
+++ b/src/modules/pager_plain/e_mod_main.c
@@ -1922,6 +1922,7 @@ _pager_window_cb_mouse_move(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EI
              drag = e_drag_new(x, y, drag_types, 2, pw, -1,
                                _pager_window_cb_drag_convert,
                                _pager_window_cb_drag_finished);
+             drag->button_mask = 
evas_pointer_button_down_mask_get(e_comp->evas);
 
              o = edje_object_add(drag->evas);
              e_theme_edje_object_set(o, "base/theme/modules/pager",
@@ -2297,6 +2298,7 @@ _pager_desk_cb_mouse_move(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EINA
         evas_object_geometry_get(pd->o_desk, &x, &y, &w, &h);
         drag = e_drag_new(x, y, drag_types, 1, pd, -1,
                           NULL, _pager_desk_cb_drag_finished);
+        drag->button_mask = evas_pointer_button_down_mask_get(e_comp->evas);
 
         /* redraw the desktop theme above */
         o = edje_object_add(drag->evas);
diff --git a/src/modules/xwayland/dnd.c b/src/modules/xwayland/dnd.c
index a7f51a5..1632e0d 100644
--- a/src/modules/xwayland/dnd.c
+++ b/src/modules/xwayland/dnd.c
@@ -203,6 +203,7 @@ _xwl_fixes_selection_notify(void *d EINA_UNUSED, int t 
EINA_UNUSED, Ecore_X_Even
              evas_pointer_canvas_xy_get(e_comp->evas, &x, &y);
              e_comp->wl_comp_data->drag_client = 
e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner);
              e_comp->wl_comp_data->drag = e_drag_new(x, y, names, num, NULL, 
0, NULL, _xwayland_drop);
+             e_comp->wl_comp_data->drag->button_mask = 
evas_pointer_button_down_mask_get(e_comp->evas);
              ecore_x_window_move_resize(e_comp->cm_selection, 0, 0, e_comp->w, 
e_comp->h);
              ecore_x_window_show(e_comp->cm_selection);
              e_drag_start(e_comp->wl_comp_data->drag, x, y);

-- 


Reply via email to