Enlightenment CVS committal

Author  : ningerso
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_callback.c 


Log Message:
Fix callback type deletion for custom types.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_callback.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_callback.c      2 Dec 2007 23:08:10 -0000       1.35
+++ ewl_callback.c      3 Dec 2007 05:31:26 -0000       1.36
@@ -543,8 +543,27 @@
        if (!EWL_CALLBACK_LEN(w, t))
                DRETURN(DLEVEL_STABLE);
 
-       while (EWL_CALLBACK_LEN(w, t))
-               ewl_callback_rm(w, t, EWL_CALLBACK_LEN(w, t) - 1);
+       if (t > EWL_CALLBACK_MAX) {
+               unsigned int i = 0;
+
+               /*
+                * Handle custom types by verifying that the event id matches
+                * the specified callback type.
+                */
+               while (i < EWL_CALLBACK_LEN(w, t)) {
+                       Ewl_Callback_Custom *cb;
+
+                       cb = (Ewl_Callback_Custom *)ewl_callback_get(w, t, i);
+                       if (cb && (cb->event_id == t))
+                               ewl_callback_rm(w, t, i);
+                       else
+                               i++;
+               }
+       }
+       else {
+               while (EWL_CALLBACK_LEN(w, t))
+                       ewl_callback_rm(w, t, EWL_CALLBACK_LEN(w, t) - 1);
+       }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to