Enlightenment CVS committal Author : englebass Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x/xlib Modified Files: ecore_x_dnd.c ecore_x_private.h Log Message: Set source action (patch from Fedor Gusev). =================================================================== RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_x_dnd.c 23 Jul 2008 10:00:01 -0000 1.1 +++ ecore_x_dnd.c 16 Aug 2008 12:53:31 -0000 1.2 @@ -35,6 +35,7 @@ _source->win = None; _source->dest = None; _source->state = ECORE_X_DND_SOURCE_IDLE; + _source->prev.window = 0; _target = calloc(1, sizeof(Ecore_X_DND_Target)); _target->win = None; @@ -335,6 +336,7 @@ ecore_x_window_ignore_set(_source->win, 1); _source->state = ECORE_X_DND_SOURCE_DRAGGING; _source->time = _ecore_x_event_last_time; + _source->prev.window = 0; /* Default Accepted Action: move */ _source->action = ECORE_X_ATOM_XDND_ACTION_MOVE; @@ -384,6 +386,8 @@ } ecore_x_window_ignore_set(_source->win, 0); + _source->prev.window = 0; + return status; } @@ -462,6 +466,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) { XEvent xev; @@ -561,6 +579,10 @@ XSendEvent(_ecore_x_disp, win, False, 0, &xev); _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/xlib/ecore_x_private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ecore_x_private.h 23 Jul 2008 10:00:01 -0000 1.1 +++ ecore_x_private.h 16 Aug 2008 12:53:31 -0000 1.2 @@ -103,6 +103,11 @@ unsigned short width, height; } rectangle; + struct { + Ecore_X_Window window; + int x, y; + } prev; + 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