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
devs/stefan/wl-session-recovery
Mike Blumenkrantz 8 years ago
parent d1ed90d160
commit 442d63d8d6
  1. 1
      src/bin/e_client.c
  2. 1
      src/bin/e_comp_wl_data.c
  3. 5
      src/bin/e_dnd.c
  4. 1
      src/bin/e_dnd.h
  5. 3
      src/bin/e_fm.c
  6. 1
      src/bin/e_gadcon.c
  7. 1
      src/bin/e_int_menus.c
  8. 1
      src/modules/gadman/e_mod_gadman.c
  9. 1
      src/modules/ibar/e_mod_main.c
  10. 1
      src/modules/ibox/e_mod_main.c
  11. 2
      src/modules/pager/e_mod_main.c
  12. 2
      src/modules/pager_plain/e_mod_main.c
  13. 1
      src/modules/xwayland/dnd.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);

@ -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);

@ -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;

@ -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;

@ -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

@ -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));

@ -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));

@ -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));

@ -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));

@ -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);

@ -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);

@ -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);

@ -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);

Loading…
Cancel
Save