Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_events.c ewl_progressbar.h 


Log Message:
Fix for a possible segv from widget destruction in a callback, documentation
update, and a minor sizing change to the filedialog test.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ewl_events.c        10 Dec 2003 01:42:17 -0000      1.45
+++ ewl_events.c        10 Dec 2003 21:52:51 -0000      1.46
@@ -255,15 +255,23 @@
                        ev->x, ev->y);
 
        /*
+        * Save the newly selected widget for further reference, do this prior
+        * to triggering the callback to avoid funkiness if the callback
+        * causes the widget to be destroyed.
+        */
+       temp = last_selected;
+       last_key = last_selected = widget;
+
+       /*
         * Determine whether this widget has already been selected, if not,
         * deselect the previously selected widget and notify it of the
         * change. Then select the new widget and notify it of the selection.
         */
-       if (widget != last_selected) {
-               if (last_selected) {
-                       ewl_object_remove_state(EWL_OBJECT(last_selected),
+       if (widget != temp) {
+               if (temp) {
+                       ewl_object_remove_state(EWL_OBJECT(temp),
                                        EWL_FLAG_STATE_SELECTED);
-                       ewl_callback_call(last_selected, EWL_CALLBACK_DESELECT);
+                       ewl_callback_call(temp, EWL_CALLBACK_DESELECT);
                }
 
                if (widget && !(ewl_object_has_state(EWL_OBJECT(widget),
@@ -295,11 +303,6 @@
                }
                temp = temp->parent;
        }
-
-       /*
-        * Save the newly selected widget for further reference
-        */
-       last_key = last_selected = widget;
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_progressbar.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ewl_progressbar.h   25 Nov 2003 07:47:29 -0000      1.5
+++ ewl_progressbar.h   10 Dec 2003 21:52:51 -0000      1.6
@@ -4,7 +4,7 @@
 
 /**
  * @defgroup Ewl_Progressbar Progressbar: A progressbar from a value
- *
+ * @{
  */
 
 /**
@@ -65,5 +65,9 @@
 void ewl_progressbar_child_add_cb(Ewl_Container *c, Ewl_Widget *w);
 void ewl_progressbar_child_resize_cb(Ewl_Container *c, Ewl_Widget *w, int size,
                                     Ewl_Orientation o);
+
+/**
+ * @}
+ */
 
 #endif                         /* __EWL_PROGRESSBAR_H__ */




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to