On Sat, Aug 16, 2008 at 02:16:35PM +0400, Fedor Gusev wrote:
> On Fri, Aug 15, 2008 at 11:17:35PM +0400, Fedor Gusev wrote:
> > Hello everyone!
> > 
> > Attached patched brings two new functions to Ecore_X:
> > 
> > EAPI void             ecore_x_dnd_source_action_set(Ecore_X_Atom action);
> > EAPI Ecore_X_Atom     ecore_x_dnd_source_action_get(void);
> > 
> > The first one sets the action that would be sent in all subsequent
> > XdndPosition messages. This action is reset to XdndActionMove in
> > ecore_x_dnd_begin().
> > The second function, obviously, gets the current action.
> > 
> > Apply from e17/libs/ecore/src/lib/ecore_x.
> > -- 
> > King regards,
> > Fedor Gusev.
> 
> Updated version.

Actually, this is not too great either. The previous root, x and y are
wrongly saved. Now they are saved if XDndPosition is sent out. But, if
you leave a XdndAware window and then call
ecore_x_dnd_source_action_set(), a XDndPosition is sent to the old window,
which should not happen.

Attached patch fixes it.

-- 
King regards,
Fedor Gusev.
Index: xcb/ecore_xcb_dnd.c
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/xcb/ecore_xcb_dnd.c,v
retrieving revision 1.2
diff -u -u -r1.2 ecore_xcb_dnd.c
--- xcb/ecore_xcb_dnd.c	16 Aug 2008 12:53:31 -0000	1.2
+++ xcb/ecore_xcb_dnd.c	16 Aug 2008 22:22:30 -0000
@@ -761,12 +761,11 @@
 	     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;
 	  }
      }
 
+   _source->prev.x = x;
+   _source->prev.y = y;
+   _source->prev.window = root;
    _source->dest = win;
 }
Index: xlib/ecore_x_dnd.c
===================================================================
RCS file: /var/cvs/e/e17/libs/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c,v
retrieving revision 1.2
diff -u -u -r1.2 ecore_x_dnd.c
--- xlib/ecore_x_dnd.c	16 Aug 2008 12:53:31 -0000	1.2
+++ xlib/ecore_x_dnd.c	16 Aug 2008 22:22:31 -0000
@@ -578,13 +578,12 @@
 	     xev.xclient.data.l[4] = _source->action; /* Version 2, Needs to be pre-set */
 	     XSendEvent(_ecore_x_disp, win, False, 0, &xev);
 
-	     _source->await_status = 1;
-   
-	     _source->prev.x = x;
-	     _source->prev.y = y;
-	     _source->prev.window = root;
+	     _source->await_status = 1; 
 	  }
      }
 
+   _source->prev.x = x;
+   _source->prev.y = y;
+   _source->prev.window = root;
    _source->dest = win;
 }
-------------------------------------------------------------------------
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-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to