Enlightenment CVS committal

Author  : englebass
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_x


Modified Files:
        Ecore_X.h ecore_x_events.c ecore_x_selection.c 


Log Message:
Convert target to string, the user will probably do this anyway.

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/Ecore_X.h,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -3 -r1.178 -r1.179
--- Ecore_X.h   13 Dec 2006 19:47:17 -0000      1.178
+++ Ecore_X.h   19 Dec 2006 06:40:30 -0000      1.179
@@ -543,7 +543,7 @@
    Ecore_X_Window    requestor;
    Ecore_X_Time      time;
    Ecore_X_Atom      selection;
-   Ecore_X_Atom      target;
+   char             *target;
    Ecore_X_Atom      property;
 };
 
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_events.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- ecore_x_events.c    13 Dec 2006 19:47:17 -0000      1.91
+++ ecore_x_events.c    19 Dec 2006 06:40:30 -0000      1.92
@@ -167,6 +167,15 @@
 }
 
 static void
+_ecore_x_event_free_selection_request(void *data __UNUSED__, void *ev)
+{
+   Ecore_X_Event_Selection_Request *e;
+
+   XFree(e->target);
+   free(e);
+}
+
+static void
 _ecore_x_event_free_selection_notify(void *data __UNUSED__, void *ev)
 {
    Ecore_X_Event_Selection_Notify *e;
@@ -1120,9 +1129,9 @@
    e->requestor = xevent->xselectionrequest.requestor;
    e->time = xevent->xselectionrequest.time;
    e->selection = xevent->xselectionrequest.selection;
-   e->target = xevent->xselectionrequest.target;
+   e->target = XGetAtomName(_ecore_x_disp, xevent->xselectionrequest.target);
    e->property = xevent->xselectionrequest.property;
-   ecore_event_add(ECORE_X_EVENT_SELECTION_REQUEST, e, NULL, NULL);
+   ecore_event_add(ECORE_X_EVENT_SELECTION_REQUEST, e, 
_ecore_x_event_free_selection_request, NULL);
 
    if ((sd = _ecore_x_selection_get(xevent->xselectionrequest.selection)) &&
        (sd->win == xevent->xselectionrequest.owner))
===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_x/ecore_x_selection.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- ecore_x_selection.c 13 Dec 2006 19:47:17 -0000      1.33
+++ ecore_x_selection.c 19 Dec 2006 06:40:30 -0000      1.34
@@ -277,6 +277,8 @@
 char *
 _ecore_x_selection_target_get(Ecore_X_Atom target)
 {
+   /* FIXME: Should not return mem allocated with strdup or X mixed,
+    * one should use free to free, the other XFree */
    if (target == ECORE_X_ATOM_FILE_NAME)
      return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
    else if (target == ECORE_X_ATOM_STRING)



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to