Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_embed.c 


Log Message:
This mouse movement dispatching seems to match what people expect better.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewl_embed.c 27 Sep 2005 04:40:09 -0000      1.8
+++ ewl_embed.c 2 Oct 2005 06:23:48 -0000       1.9
@@ -473,31 +473,44 @@
 void
 ewl_embed_mouse_move_feed(Ewl_Embed *embed, int x, int y, unsigned int mods)
 {
-       Ewl_Widget *widget;
+       Ewl_Widget *widget = NULL;
        Ewl_Event_Mouse_Move ev;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("embed", embed);
 
-       widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed),
-                       x, y);
-       if (!widget)
-               widget = EWL_WIDGET(embed);
-
        ev.modifiers = mods;
        ev.x = x;
        ev.y = y;
 
        /*
-        * Defocus all widgets up to the level of a shared parent of old and
-        * newly focused widgets.
+        * Focus a new widget if the mouse isn't pressed on the currently
+        * focused widget.
         */
-       while (last_focused && (widget != last_focused) &&
-                       !ewl_container_parent_of(last_focused, widget)) {
-               ewl_object_state_remove(EWL_OBJECT(last_focused),
-                               EWL_FLAG_STATE_HILITED);
-               ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
-               last_focused = last_focused->parent;
+       if (!last_focused || !ewl_object_state_has(EWL_OBJECT(last_focused), 
EWL_FLAG_STATE_PRESSED)) {
+
+               widget = 
ewl_container_child_at_recursive_get(EWL_CONTAINER(embed),
+                               x, y);
+               if (!widget)
+                       widget = EWL_WIDGET(embed);
+       }
+
+       if (widget) {
+               /*
+                * Defocus all widgets up to the level of a shared parent of
+                * old and newly focused widgets.
+                */
+               while (last_focused && (widget != last_focused) &&
+                               !ewl_container_parent_of(last_focused, widget)) 
{
+                       ewl_object_state_remove(EWL_OBJECT(last_focused),
+                                       EWL_FLAG_STATE_HILITED);
+                       ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
+                       last_focused = last_focused->parent;
+               }
+
+       }
+       else {
+               widget = last_focused;
        }
 
        /*




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to