i'm cleaning up dnd. fixed leaks. made dnd more convenient - less work to do

(it returns x,y coords relative to the drop target geom, not the screen,
start putting in all the necessary stuff in fm2 - can dnd 2 file now (drop
has no effect though)...


SVN revision: 25950
This commit is contained in:
Carsten Haitzler 2006-09-18 03:49:45 +00:00
parent 9cc3d3a01e
commit a9757fa04b
18 changed files with 860 additions and 598 deletions

View File

@ -4719,9 +4719,10 @@ _e_border_cb_mouse_move(void *data, int type, void *event)
e_drag_resize(drag, w, h);
e_drag_start(drag, bd->drag.x, bd->drag.y);
evas_event_feed_mouse_up(bd->bg_evas, 1,
EVAS_BUTTON_NONE, ev->time,
NULL);
e_util_evas_fake_mouse_up_later(bd->bg_evas, 1);
// evas_event_feed_mouse_up(bd->bg_evas, 1,
// EVAS_BUTTON_NONE, ev->time,
// NULL);
}
bd->drag.start = 0;
}

View File

@ -509,30 +509,14 @@ _e_drag_coords_update(E_Drop_Handler *h, int *dx, int *dy, int *dw, int *dh)
case E_WIN_TYPE:
px = ((E_Win *)(h->obj))->x;
py = ((E_Win *)(h->obj))->y;
if ((((E_Win *)(h->obj))->border) &&
(((E_Win *)(h->obj))->border->zone))
{
px -= ((E_Win *)(h->obj))->border->zone->x;
py -= ((E_Win *)(h->obj))->border->zone->y;
}
break;
case E_BORDER_TYPE:
px = ((E_Border *)(h->obj))->x + ((E_Border *)(h->obj))->fx.x;
py = ((E_Border *)(h->obj))->y + ((E_Border *)(h->obj))->fx.y;
if (((E_Border *)(h->obj))->zone)
{
px -= ((E_Border *)(h->obj))->zone->x;
py -= ((E_Border *)(h->obj))->zone->y;
}
break;
case E_POPUP_TYPE:
px = ((E_Popup *)(h->obj))->x;
py = ((E_Popup *)(h->obj))->y;
if (((E_Popup *)(h->obj))->zone)
{
px -= ((E_Popup *)(h->obj))->zone->x;
py -= ((E_Popup *)(h->obj))->zone->y;
}
break;
/* FIXME: add mroe types as needed */
default:
@ -577,9 +561,9 @@ static void
_e_drag_update(int x, int y)
{
Evas_List *l;
E_Event_Dnd_Enter *enter_ev;
E_Event_Dnd_Move *move_ev;
E_Event_Dnd_Leave *leave_ev;
E_Event_Dnd_Enter enter_ev;
E_Event_Dnd_Move move_ev;
E_Event_Dnd_Leave leave_ev;
int dx, dy, dw, dh;
Ecore_X_Window win, ignore_win[2];
@ -588,7 +572,7 @@ _e_drag_update(int x, int y)
ignore_win[0] = _drag_current->evas_win;
ignore_win[1] = _drag_win;
/* this is nasty - but necessary to get the window stacking */
win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2);
win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2);
}
else
win = ecore_x_window_at_xy_with_skip_get(x, y, NULL, 0);
@ -599,18 +583,6 @@ _e_drag_update(int x, int y)
_e_drag_move(_drag_current, x, y);
}
enter_ev = E_NEW(E_Event_Dnd_Enter, 1);
enter_ev->x = x;
enter_ev->y = y;
move_ev = E_NEW(E_Event_Dnd_Move, 1);
move_ev->x = x;
move_ev->y = y;
leave_ev = E_NEW(E_Event_Dnd_Leave, 1);
leave_ev->x = x;
leave_ev->y = y;
if ((_drag_current) && (_drag_current->types))
{
for (l = _drop_handlers; l; l = l->next)
@ -620,24 +592,30 @@ _e_drag_update(int x, int y)
h = l->data;
if (!h->active) continue;
_e_drag_coords_update(h, &dx, &dy, &dw, &dh);
enter_ev.x = x - dx;
enter_ev.y = y - dy;
move_ev.x = x - dx;
move_ev.y = y - dy;
leave_ev.x = x - dx;
leave_ev.y = y - dy;
if ((_e_drag_win_matches(h, win)) &&
(E_INSIDE(x, y, dx, dy, dw, dh)))
{
if (!h->entered)
{
if (h->cb.enter)
h->cb.enter(h->cb.data, _drag_current->types[0], enter_ev);
h->cb.enter(h->cb.data, _drag_current->types[0], &enter_ev);
h->entered = 1;
}
if (h->cb.move)
h->cb.move(h->cb.data, _drag_current->types[0], move_ev);
h->cb.move(h->cb.data, _drag_current->types[0], &move_ev);
}
else
{
if (h->entered)
{
if (h->cb.leave)
h->cb.leave(h->cb.data, _drag_current->types[0], leave_ev);
h->cb.leave(h->cb.data, _drag_current->types[0], &leave_ev);
h->entered = 0;
}
}
@ -652,32 +630,35 @@ _e_drag_update(int x, int y)
h = l->data;
if (!h->active) continue;
_e_drag_coords_update(h, &dx, &dy, &dw, &dh);
enter_ev.x = x - dx;
enter_ev.y = y - dy;
move_ev.x = x - dx;
move_ev.y = y - dy;
leave_ev.x = x - dx;
leave_ev.y = y - dy;
if ((_e_drag_win_matches(h, win)) &&
(E_INSIDE(x, y, dx, dy, dw, dh)))
{
if (!h->entered)
{
if (h->cb.enter)
h->cb.enter(h->cb.data, _xdnd->type, enter_ev);
h->cb.enter(h->cb.data, _xdnd->type, &enter_ev);
h->entered = 1;
}
if (h->cb.move)
h->cb.move(h->cb.data, _xdnd->type, move_ev);
h->cb.move(h->cb.data, _xdnd->type, &move_ev);
}
else
{
if (h->entered)
{
if (h->cb.leave)
h->cb.leave(h->cb.data, _xdnd->type, leave_ev);
h->cb.leave(h->cb.data, _xdnd->type, &leave_ev);
h->entered = 0;
}
}
}
}
free(enter_ev);
free(move_ev);
free(leave_ev);
}
static void
@ -685,7 +666,7 @@ _e_drag_end(int x, int y)
{
E_Zone *zone;
Evas_List *l;
E_Event_Dnd_Drop *ev;
E_Event_Dnd_Drop ev;
const char *type = NULL;
int dx, dy, dw, dh;
Ecore_X_Window win, ignore_win[2];
@ -694,7 +675,7 @@ _e_drag_end(int x, int y)
ignore_win[0] = _drag_current->evas_win;
ignore_win[1] = _drag_win;
/* this is nasty - but necessary to get the window stacking */
win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2);
win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2);
zone = e_container_zone_at_point_get(_drag_current->container, x, y);
/* Pass -1, -1, so that it is possible to drop at the edge. */
if (zone) e_zone_flip_coords_handle(zone, -1, -1);
@ -717,13 +698,9 @@ _e_drag_end(int x, int y)
ecore_x_window_del(_drag_win);
_drag_win = 0;
ev = E_NEW(E_Event_Dnd_Drop, 1);
ev->data = _drag_current->data;
ev.data = _drag_current->data;
type = _drag_current->types[0];
ev->x = x;
ev->y = y;
if (ev->data)
if (ev.data)
{
int dropped;
@ -735,11 +712,13 @@ _e_drag_end(int x, int y)
h = l->data;
if (!h->active) continue;
_e_drag_coords_update(h, &dx, &dy, &dw, &dh);
ev.x = x - dx;
ev.y = y - dy;
if ((_e_drag_win_matches(h, win)) &&
((h->cb.drop) &&
(E_INSIDE(x, y, dx, dy, dw, dh))))
{
h->cb.drop(h->cb.data, type, ev);
h->cb.drop(h->cb.data, type, &ev);
dropped = 1;
}
}
@ -751,12 +730,11 @@ _e_drag_end(int x, int y)
else
{
/* Just leave */
E_Event_Dnd_Leave *leave_ev;
E_Event_Dnd_Leave leave_ev;
leave_ev = E_NEW(E_Event_Dnd_Leave, 1);
/* FIXME: We don't need x and y in leave */
leave_ev->x = 0;
leave_ev->y = 0;
leave_ev.x = 0;
leave_ev.y = 0;
for (l = _drop_handlers; l; l = l->next)
{
@ -770,20 +748,18 @@ _e_drag_end(int x, int y)
if (h->entered)
{
if (h->cb.leave)
h->cb.leave(h->cb.data, type, leave_ev);
h->cb.leave(h->cb.data, type, &leave_ev);
h->entered = 0;
}
}
}
free(ev);
}
static void
_e_drag_xdnd_end(int x, int y)
{
Evas_List *l;
E_Event_Dnd_Drop *ev;
E_Event_Dnd_Drop ev;
const char *type = NULL;
int dx, dy, dw, dh;
Ecore_X_Window win, ignore_win[2];
@ -794,18 +770,15 @@ _e_drag_xdnd_end(int x, int y)
ignore_win[0] = _drag_current->evas_win;
ignore_win[1] = _drag_win;
/* this is nasty - but necessary to get the window stacking */
win = ecore_x_window_at_xy_with_skip_get(x, y, &ignore_win, 2);
win = ecore_x_window_at_xy_with_skip_get(x, y, ignore_win, 2);
}
else
win = ecore_x_window_at_xy_with_skip_get(x, y, NULL, 0);
ev = E_NEW(E_Event_Dnd_Drop, 1);
ev->data = _xdnd->data;
ev.data = _xdnd->data;
type = _xdnd->type;
ev->x = x;
ev->y = y;
if (ev->data)
if (ev.data)
{
int dropped;
@ -817,11 +790,13 @@ _e_drag_xdnd_end(int x, int y)
h = l->data;
if (!h->active) continue;
_e_drag_coords_update(h, &dx, &dy, &dw, &dh);
ev.x = x - dx;
ev.y = y - dy;
if ((_e_drag_win_matches(h, win)) &&
((h->cb.drop) &&
(E_INSIDE(x, y, dx, dy, dw, dh))))
{
h->cb.drop(h->cb.data, type, ev);
h->cb.drop(h->cb.data, type, &ev);
dropped = 1;
}
}
@ -829,12 +804,11 @@ _e_drag_xdnd_end(int x, int y)
else
{
/* Just leave */
E_Event_Dnd_Leave *leave_ev;
E_Event_Dnd_Leave leave_ev;
leave_ev = E_NEW(E_Event_Dnd_Leave, 1);
/* FIXME: We don't need x and y in leave */
leave_ev->x = 0;
leave_ev->y = 0;
leave_ev.x = 0;
leave_ev.y = 0;
for (l = _drop_handlers; l; l = l->next)
{
@ -848,13 +822,11 @@ _e_drag_xdnd_end(int x, int y)
if (h->entered)
{
if (h->cb.leave)
h->cb.leave(h->cb.data, type, leave_ev);
h->cb.leave(h->cb.data, type, &leave_ev);
h->entered = 0;
}
}
}
free(ev);
}
static void
@ -872,8 +844,7 @@ _e_drag_free(E_Drag *drag)
evas_object_del(drag->object);
e_canvas_del(drag->ecore_evas);
ecore_evas_free(drag->ecore_evas);
for (i = 0; i < drag->num_types; i++)
free(drag->types[i]);
for (i = 0; i < drag->num_types; i++) free(drag->types[i]);
free(drag->types);
free(drag);
}

File diff suppressed because it is too large Load Diff

View File

@ -116,7 +116,8 @@ EAPI void e_fm2_select_set(Evas_Object *obj, const char *file,
EAPI void e_fm2_file_show(Evas_Object *obj, const char *file);
EAPI void e_fm2_icon_menu_start_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void e_fm2_icon_menu_end_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj);
EAPI void e_fm2_pan_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
EAPI void e_fm2_pan_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
EAPI void e_fm2_pan_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);

View File

@ -1200,8 +1200,10 @@ _e_gadcon_client_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *even
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -1521,8 +1523,10 @@ _e_gadcon_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_in
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}

View File

@ -140,6 +140,7 @@ e_int_config_wallpaper_import(E_Config_Dialog *parent)
_import_cb_sel_selected, import,
_import_cb_sel_change, import, 1
);
e_widget_fsel_window_object_set(ofm, win);
import->fsel_obj = ofm;
e_widget_list_object_append(o, ofm, 1, 1, 0.5);

View File

@ -923,8 +923,10 @@ _e_shelf_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_inf
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(es->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(es->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(es->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}

View File

@ -22,7 +22,7 @@ typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;
struct _E_Util_Fake_Mouse_Up_Info
{
E_Container *con;
Evas *evas;
int button;
};
@ -37,19 +37,10 @@ static Ecore_Timer *_e_util_dummy_timer = NULL;
EAPI void
e_util_container_fake_mouse_up_later(E_Container *con, int button)
{
E_Util_Fake_Mouse_Up_Info *info;
E_OBJECT_CHECK(con);
E_OBJECT_TYPE_CHECK(con, E_CONTAINER_TYPE);
info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info));
if (info)
{
info->con = con;
info->button = button;
e_object_ref(E_OBJECT(info->con));
ecore_job_add(_e_util_container_fake_mouse_up_cb, info);
}
e_util_evas_fake_mouse_up_later(con->bg_evas, button);
}
EAPI void
@ -63,6 +54,20 @@ e_util_container_fake_mouse_up_all_later(E_Container *con)
e_util_container_fake_mouse_up_later(con, 3);
}
EAPI void
e_util_evas_fake_mouse_up_later(Evas *e, int button)
{
E_Util_Fake_Mouse_Up_Info *info;
info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info));
if (info)
{
info->evas = e;
info->button = button;
ecore_job_add(_e_util_container_fake_mouse_up_cb, info);
}
}
EAPI void
e_util_wakeup(void)
{
@ -675,8 +680,8 @@ _e_util_container_fake_mouse_up_cb(void *data)
info = data;
if (info)
{
evas_event_feed_mouse_up(info->con->bg_evas, info->button, EVAS_BUTTON_NONE, ecore_x_current_time_get(), NULL);
e_object_unref(E_OBJECT(info->con));
evas_event_feed_mouse_up(info->evas, info->button, EVAS_BUTTON_NONE,
ecore_x_current_time_get(), NULL);
free(info);
}
}

View File

@ -17,6 +17,7 @@
EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button);
EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con);
EAPI void e_util_evas_fake_mouse_up_later(Evas *e, int button);
EAPI void e_util_wakeup(void);
EAPI void e_util_env_set(const char *var, const char *val);
EAPI E_Zone *e_util_zone_current_get(E_Manager *man);

View File

@ -542,6 +542,17 @@ e_widget_fsel_selection_path_get(Evas_Object *obj)
return wd->path;
}
EAPI void
e_widget_fsel_window_object_set(Evas_Object *obj, E_Object *eobj)
{
E_Widget_Data *wd;
if (!obj) return NULL;
wd = e_widget_data_get(obj);
e_fm2_window_object_set(wd->o_favorites_fm, eobj);
e_fm2_window_object_set(wd->o_files_fm, eobj);
}
static void
_e_wid_fsel_preview_update(void *data, Evas_Object *obj, void *event_info)
{

View File

@ -9,8 +9,9 @@
EAPI Evas_Object *e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected, char *filter,
void (*sel_func) (void *data, Evas_Object *obj), void *sel_data,
void (*chg_func) (void *data, Evas_Object *obj), void *chg_data, int preview);
EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj);
EAPI void e_widget_fsel_path_get(Evas_Object *obj, const char **dev, const char **path);
EAPI const char *e_widget_fsel_selection_path_get(Evas_Object *obj);
EAPI void e_widget_fsel_window_object_set(Evas_Object *obj, E_Object *eobj);
#endif
#endif

View File

@ -184,8 +184,10 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}

View File

@ -289,8 +289,10 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}

View File

@ -307,8 +307,10 @@ _ibar_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(b->inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -933,8 +935,10 @@ _ibar_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(ic->ibar->inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(ic->ibar->inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(ic->ibar->inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -989,9 +993,11 @@ _ibar_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info
e_drag_resize(d, w, h);
e_drag_start(d, ic->drag.x, ic->drag.y);
evas_event_feed_mouse_up(ic->ibar->inst->gcc->gadcon->evas,
1, EVAS_BUTTON_NONE,
ecore_x_current_time_get(), NULL);
e_util_evas_fake_mouse_up_later(ic->ibar->inst->gcc->gadcon->evas,
1);
// evas_event_feed_mouse_up(ic->ibar->inst->gcc->gadcon->evas,
// 1, EVAS_BUTTON_NONE,
// ecore_x_current_time_get(), NULL);
e_object_ref(E_OBJECT(ic->app));
ic->ibar->icons = evas_list_remove(ic->ibar->icons, ic);
_ibar_resize_handle(ic->ibar);
@ -1061,7 +1067,7 @@ _ibar_inst_cb_enter(void *data, const char *type, void *event_info)
Instance *inst;
Evas_Object *o, *o2;
IBar_Icon *ic;
int cx, cy, cw, ch;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
@ -1078,8 +1084,8 @@ _ibar_inst_cb_enter(void *data, const char *type, void *event_info)
evas_object_layer_set(o2, 19999);
evas_object_show(o);
evas_object_show(o2);
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
ic = _ibar_icon_at_coord(inst->ibar, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->ibar->o_box, &xx, &yy, NULL, NULL);
ic = _ibar_icon_at_coord(inst->ibar, ev->x + xx, ev->y + yy);
inst->ibar->ic_drop_before = ic;
if (ic)
{
@ -1089,11 +1095,11 @@ _ibar_inst_cb_enter(void *data, const char *type, void *event_info)
evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
if (e_box_orientation_get(inst->ibar->o_box))
{
if ((ev->x - cx) < (ix + (iw / 2))) before = 1;
if ((ev->x + xx) < (ix + (iw / 2))) before = 1;
}
else
{
if ((ev->y - cy) < (iy + (ih / 2))) before = 1;
if ((ev->y + yy) < (iy + (ih / 2))) before = 1;
}
if (before)
e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);
@ -1119,13 +1125,13 @@ _ibar_inst_cb_move(void *data, const char *type, void *event_info)
E_Event_Dnd_Move *ev;
Instance *inst;
IBar_Icon *ic;
int cx, cy, cw, ch;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
e_box_unpack(inst->ibar->o_drop);
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
ic = _ibar_icon_at_coord(inst->ibar, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->ibar->o_box, &xx, &yy, NULL, NULL);
ic = _ibar_icon_at_coord(inst->ibar, ev->x + xx, ev->y + yy);
inst->ibar->ic_drop_before = ic;
if (ic)
{
@ -1135,11 +1141,11 @@ _ibar_inst_cb_move(void *data, const char *type, void *event_info)
evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
if (e_box_orientation_get(inst->ibar->o_box))
{
if ((ev->x - cx) < (ix + (iw / 2))) before = 1;
if ((ev->x + xx) < (ix + (iw / 2))) before = 1;
}
else
{
if ((ev->y - cy) < (iy + (ih / 2))) before = 1;
if ((ev->y + yy) < (iy + (ih / 2))) before = 1;
}
if (before)
e_box_pack_before(inst->ibar->o_box, inst->ibar->o_drop, ic->o_holder);

View File

@ -297,8 +297,9 @@ _ibox_cb_empty_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_inf
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(b->inst->gcc->gadcon->evas, ev->button);
// evas_event_feed_mouse_up(b->inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -684,8 +685,10 @@ _ibox_cb_icon_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(ic->ibox->inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(ic->ibox->inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(ic->ibox->inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -738,9 +741,11 @@ _ibox_cb_icon_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info
e_drag_resize(d, w, h);
e_drag_start(d, ic->drag.x, ic->drag.y);
evas_event_feed_mouse_up(ic->ibox->inst->gcc->gadcon->evas,
1, EVAS_BUTTON_NONE,
ecore_x_current_time_get(), NULL);
e_util_evas_fake_mouse_up_later(ic->ibox->inst->gcc->gadcon->evas,
1);
// evas_event_feed_mouse_up(ic->ibox->inst->gcc->gadcon->evas,
// 1, EVAS_BUTTON_NONE,
// ecore_x_current_time_get(), NULL);
e_object_ref(E_OBJECT(ic->border));
ic->ibox->icons = evas_list_remove(ic->ibox->icons, ic);
_ibox_resize_handle(ic->ibox);
@ -813,7 +818,7 @@ _ibox_inst_cb_enter(void *data, const char *type, void *event_info)
Instance *inst;
Evas_Object *o, *o2;
IBox_Icon *ic;
int cx, cy, cw, ch;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
@ -830,8 +835,8 @@ _ibox_inst_cb_enter(void *data, const char *type, void *event_info)
evas_object_layer_set(o2, 19999);
evas_object_show(o);
evas_object_show(o2);
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
ic = _ibox_icon_at_coord(inst->ibox, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->ibox->o_box, &xx, &yy, NULL, NULL);
ic = _ibox_icon_at_coord(inst->ibox, ev->x + xx, ev->y + yy);
inst->ibox->ic_drop_before = ic;
if (ic)
{
@ -841,11 +846,11 @@ _ibox_inst_cb_enter(void *data, const char *type, void *event_info)
evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
if (e_box_orientation_get(inst->ibox->o_box))
{
if ((ev->x - cx) < (ix + (iw / 2))) before = 1;
if ((ev->x + xx) < (ix + (iw / 2))) before = 1;
}
else
{
if ((ev->y - cy) < (iy + (ih / 2))) before = 1;
if ((ev->y + yy) < (iy + (ih / 2))) before = 1;
}
if (before)
e_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder);
@ -871,13 +876,13 @@ _ibox_inst_cb_move(void *data, const char *type, void *event_info)
E_Event_Dnd_Move *ev;
Instance *inst;
IBox_Icon *ic;
int cx, cy, cw, ch;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
e_box_unpack(inst->ibox->o_drop);
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
ic = _ibox_icon_at_coord(inst->ibox, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->ibox->o_box, &xx, &yy, NULL, NULL);
ic = _ibox_icon_at_coord(inst->ibox, ev->x, ev->y);
inst->ibox->ic_drop_before = ic;
if (ic)
{
@ -887,11 +892,11 @@ _ibox_inst_cb_move(void *data, const char *type, void *event_info)
evas_object_geometry_get(ic->o_holder, &ix, &iy, &iw, &ih);
if (e_box_orientation_get(inst->ibox->o_box))
{
if ((ev->x - cx) < (ix + (iw / 2))) before = 1;
if ((ev->x + xx) < (ix + (iw / 2))) before = 1;
}
else
{
if ((ev->y - cy) < (iy + (ih / 2))) before = 1;
if ((ev->y + yy) < (iy + (ih / 2))) before = 1;
}
if (before)
e_box_pack_before(inst->ibox->o_box, inst->ibox->o_drop, ic->o_holder);

View File

@ -632,8 +632,10 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
@ -1391,9 +1393,11 @@ _pager_window_cb_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_i
pw->drag.from_pager = pw->desk->pager;
pw->drag.from_pager->dragging = 1;
pw->drag.in_pager = 0;
evas_event_feed_mouse_up(evas_object_evas_get(pw->desk->pager->o_table),
pw->drag.button, EVAS_BUTTON_NONE,
ecore_x_current_time_get(), NULL);
e_util_evas_fake_mouse_up_later(evas_object_evas_get(pw->desk->pager->o_table),
pw->drag.button);
// evas_event_feed_mouse_up(evas_object_evas_get(pw->desk->pager->o_table),
// pw->drag.button, EVAS_BUTTON_NONE,
// ecore_x_current_time_get(), NULL);
}
}
}
@ -1470,12 +1474,12 @@ _pager_inst_cb_move(void *data, const char *type, void *event_info)
Instance *inst;
Pager_Desk *pd, *pd2;
Evas_List *l;
int cx, cy, cw, ch;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
pd = _pager_desk_at_coord(inst->pager, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->pager->o_table, &xx, &yy, NULL, NULL);
pd = _pager_desk_at_coord(inst->pager, ev->x + xx, ev->y + yy);
/* FIXME: keep track which one its over so we only emit drag in/out
* when it actually goes form one desk to another */
for (l = inst->pager->desks; l; l = l->next)
@ -1517,13 +1521,14 @@ _pager_inst_cb_drop(void *data, const char *type, void *event_info)
E_Border *bd = NULL;
Evas_List *l;
int dx = 0, dy = 0;
int cx, cy, cw, ch;
Pager_Win *pw = NULL;
Evas_Coord xx, yy;
ev = event_info;
inst = data;
e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &cx, &cy, &cw, &ch);
pd = _pager_desk_at_coord(inst->pager, ev->x - cx, ev->y - cy);
evas_object_geometry_get(inst->pager->o_table, &xx, &yy, NULL, NULL);
pd = _pager_desk_at_coord(inst->pager, ev->x + xx, ev->y + yy);
if (pd)
{
if (!strcmp(type, "enlightenment/pager_win"))
@ -1558,7 +1563,8 @@ _pager_inst_cb_drop(void *data, const char *type, void *event_info)
if ((!pw) || ((pw) && (!pw->drag.no_place)))
{
e_layout_coord_canvas_to_virtual(pd->o_layout,
ev->x - cx + dx, ev->y - cy + dy,
ev->x + xx + dx,
ev->y + yy + dy,
&nx, &ny);
e_border_move(bd, nx + pd->desk->zone->x, ny + pd->desk->zone->y);
}

View File

@ -197,8 +197,10 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
x, y, w, h,
dir, ev->timestamp);
edje_object_signal_emit(inst->o_button, "e,state,focused", "e");
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}
}

View File

@ -154,8 +154,10 @@ _button_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
e_util_zone_current_get(e_manager_current_get()),
cx + ev->output.x, cy + ev->output.y, 1, 1,
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
EVAS_BUTTON_NONE, ev->timestamp, NULL);
e_util_evas_fake_mouse_up_later(inst->gcc->gadcon->evas,
ev->button);
// evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
// EVAS_BUTTON_NONE, ev->timestamp, NULL);
}
}