Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewins.c ewins.h focus.c 


Log Message:
Tweak click-raises (raise if lowered after getting focus).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -3 -r1.114 -r1.115
--- ewins.c     18 Oct 2005 19:05:22 -0000      1.114
+++ ewins.c     18 Oct 2005 19:21:25 -0000      1.115
@@ -1259,6 +1259,8 @@
    if (lst)
       Efree(lst);
 
+   FocusEwinSetGrabs(ewin);
+
    if (call_depth == 1)
       ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
 
@@ -1292,6 +1294,8 @@
    if (lst)
       Efree(lst);
 
+   FocusEwinSetGrabs(ewin);
+
    if (call_depth == 1)
       ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewins.h     12 Oct 2005 17:20:42 -0000      1.17
+++ ewins.h     18 Oct 2005 19:21:25 -0000      1.18
@@ -65,6 +65,7 @@
       char                shaded;
 
       unsigned            placed:1;
+      unsigned            click_grab_isset:1;
       unsigned            maximized_horz:1;
       unsigned            maximized_vert:1;
       unsigned            fullscreen:1;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -3 -r1.123 -r1.124
--- focus.c     16 Oct 2005 16:02:56 -0000      1.123
+++ focus.c     18 Oct 2005 19:21:25 -0000      1.124
@@ -199,25 +199,39 @@
 void
 FocusEwinSetGrabs(EWin * ewin)
 {
-   if ((Conf.focus.mode != MODE_FOCUS_CLICK &&
-       ewin->state.active && Conf.focus.clickraises &&
-       ewin != EwinListStackGetTop()) ||
-       (Conf.focus.mode == MODE_FOCUS_CLICK && !ewin->state.active))
+   int                 set = 0;
+
+   if (Conf.focus.mode == MODE_FOCUS_CLICK)
      {
-       GrabButtonSet(AnyButton, AnyModifier, _EwinGetContainerWin(ewin),
-                     ButtonPressMask, ECSR_PGRAB, 1);
-#if 0
-       Eprintf("FocusEwinSetGrabs: %#lx grab %s\n", _EwinGetClientXwin(ewin),
-               EwinGetName(ewin));
-#endif
+       set = !ewin->state.active;
+     }
+   if (ewin->state.active && Conf.focus.clickraises &&
+       ewin != EwinListStackGetTop())
+      set = 1;
+
+   if (set)
+     {
+       if (!ewin->state.click_grab_isset)
+         {
+            GrabButtonSet(AnyButton, AnyModifier, _EwinGetContainerWin(ewin),
+                          ButtonPressMask, ECSR_PGRAB, 1);
+            if (EventDebug(EDBUG_TYPE_GRABS))
+               Eprintf("FocusEwinSetGrabs: %#lx set %s\n",
+                       _EwinGetClientXwin(ewin), EwinGetName(ewin));
+            ewin->state.click_grab_isset = 1;
+         }
      }
    else
      {
-       GrabButtonRelease(AnyButton, AnyModifier, _EwinGetContainerWin(ewin));
-#if 0
-       Eprintf("FocusEwinSetGrabs: %#lx ungrab %s\n", _EwinGetClientXwin(ewin),
-               EwinGetName(ewin));
-#endif
+       if (ewin->state.click_grab_isset)
+         {
+            GrabButtonRelease(AnyButton, AnyModifier,
+                              _EwinGetContainerWin(ewin));
+            if (EventDebug(EDBUG_TYPE_GRABS))
+               Eprintf("FocusEwinSetGrabs: %#lx unset %s\n",
+                       _EwinGetClientXwin(ewin), EwinGetName(ewin));
+            ewin->state.click_grab_isset = 0;
+         }
      }
 }
 




-------------------------------------------------------
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