Enlightenment CVS committal Author : englebass Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x/xcb Modified Files: ecore_xcb_dnd.c ecore_xcb_private.h Log Message: Set source action (patch from Fedor Gusev). =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_xcb_dnd.c 23 Jul 2008 10:00:01 -0000 1.1 +++ ecore_xcb_dnd.c 16 Aug 2008 12:53:31 -0000 1.2 @@ -30,6 +30,7 @@ _source->win = XCB_NONE; _source->dest = XCB_NONE; _source->state = ECORE_X_DND_SOURCE_IDLE; + _source->prev.window = 0; _target = calloc(1, sizeof(Ecore_X_DND_Target)); _target->win = XCB_NONE; @@ -485,6 +486,7 @@ ecore_x_window_ignore_set(_source->win, 1); _source->state = ECORE_X_DND_SOURCE_DRAGGING; _source->time = _ecore_xcb_event_last_time; + _source->prev.window = 0; /* Default Accepted Action: ask */ _source->action = ECORE_X_ATOM_XDND_ACTION_COPY; @@ -532,6 +534,7 @@ } ecore_x_window_ignore_set(_source->win, 0); + _source->prev.window = 0; _source->dest = XCB_NONE; return status; @@ -611,6 +614,20 @@ } void +ecore_x_dnd_source_action_set(Ecore_X_Atom action) +{ + _source->action = action; + if (_source->prev.window) + _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y); +} + +Ecore_X_Atom +ecore_x_dnd_source_action_get(void) +{ + return _source->action; +} + +void _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y) @@ -744,6 +761,10 @@ xcb_send_event(_ecore_xcb_conn, 0, win, 0, (const char *)&ev); _source->await_status = 1; + + _source->prev.x = x; + _source->prev.y = y; + _source->prev.window = root; } } =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/xcb/ecore_xcb_private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_xcb_private.h 23 Jul 2008 10:00:01 -0000 1.1 +++ ecore_xcb_private.h 16 Aug 2008 12:53:31 -0000 1.2 @@ -107,6 +107,11 @@ unsigned short width, height; } rectangle; + struct { + Ecore_X_Window window; + int x, y; + } prev; + Ecore_X_Time time; Ecore_X_Atom action, accepted_action; ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs