From: <enl...@li...> - 2004-01-06 21:06:55
|
Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl Dir : e17/libs/ewl/src Modified Files: ewl_callback.c ewl_events.c Log Message: Dispatch key up events consistent to the way key down is handled, and make callback intercepting slightly cleaner. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_callback.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- ewl_callback.c 9 Dec 2003 21:24:03 -0000 1.35 +++ ewl_callback.c 6 Jan 2004 21:06:54 -0000 1.36 @@ -282,15 +282,14 @@ parent = parent->parent; } - if (top) { - ewl_callback_call_with_event_data(top, t, ev_data); - DRETURN(DLEVEL_STABLE); - } + if (top) + w = top; /* * Now search up the tree to find the first notified widget. This may * result in some recursion. */ + top = NULL; parent = w->parent; while (parent) { if (EWL_CALLBACK_FLAGS(parent, t) & EWL_CALLBACK_NOTIFY_NOTIFY) =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -3 -r1.46 -r1.47 --- ewl_events.c 10 Dec 2003 21:52:51 -0000 1.46 +++ ewl_events.c 6 Jan 2004 21:06:54 -0000 1.47 @@ -203,9 +203,7 @@ */ int ewl_ev_key_up(void *data, int type, void *_ev) { - /* - * Dispatch key up events to the appropriate widget - */ + Ewl_Widget *temp; Ewl_Embed *embed; Ecore_X_Event_Key_Up *ev; @@ -218,12 +216,17 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); /* - * If a widget has received a keydown event, then it should receive a - * matching key up event + * Dispatcher of key up events, these get sent to the last widget + * selected, and every parent above it. */ - if (last_key) - ewl_callback_call_with_event_data(last_key, EWL_CALLBACK_KEY_UP, - ev); + temp = last_key; + while (temp) { + if (!(ewl_object_has_state(EWL_OBJECT(temp), + EWL_FLAG_STATE_DISABLED))) + ewl_callback_call_with_event_data(temp, + EWL_CALLBACK_KEY_UP, ev); + temp = temp->parent; + } DRETURN_INT(TRUE, DLEVEL_STABLE); } |