Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h desktops.c events.c main.c settings.c setup.c timestamp.h 
        warp.c 


Log Message:
Sun Aug 10 17:26:18 CEST 2003
(Kim)

Fixed focus list not always being closed when it should be.

===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -3 -r1.132 -r1.133
--- E.h 20 Jul 2003 18:02:15 -0000      1.132
+++ E.h 10 Aug 2003 15:44:46 -0000      1.133
@@ -2985,12 +2985,9 @@
 
 void                BGSettingsGoTo(Background * bg);
 
-void                WarpFocusInitEvents(void);
 int                 WarpFocusHandleEvent(XEvent * event);
 void                WarpFocus(int delta);
 void                WarpFocusFinish(void);
-void                WarpFocusShowTitle(EWin * ewin);
-void                WarpFocusHideTitle(void);
 
 /* groups.c functions */
 Group              *CreateGroup(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- desktops.c  12 Jul 2003 15:04:31 -0000      1.42
+++ desktops.c  10 Aug 2003 15:44:47 -0000      1.43
@@ -1452,7 +1452,6 @@
       EDBUG_RETURN_;
    pdesk = desks.current;
 
-   WarpFocusFinish();
    if (mode.slideout)
       HideSlideout(mode.slideout, mode.context_win);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- events.c    11 Jul 2003 19:45:56 -0000      1.32
+++ events.c    10 Aug 2003 15:44:47 -0000      1.33
@@ -671,9 +671,10 @@
    int                 i, num;
 
    EDBUG(7, "HandleEvent");
-   WarpFocusHandleEvent(ev);
+
    if (ev->type == event_base_shape + ShapeNotify)
       HandleChildShapeChange(ev);
+
    if ((ev->type == KeyPress) || (ev->type == KeyRelease)
        || (ev->type == ButtonPress) || (ev->type == ButtonRelease)
        || (ev->type == EnterNotify) || (ev->type == LeaveNotify))
@@ -689,6 +690,7 @@
          }
        else
          {
+            WarpFocusHandleEvent(ev);
             lst = ListItemType(&num, LIST_TYPE_ACLASS_GLOBAL);
             if (lst)
               {
@@ -698,8 +700,10 @@
               }
          }
      }
+
    if (ev->type <= 35)
       HArray[ev->type].func(ev);
+
    IconboxHandleEvent(ev);
 
    if (diddeskaccount)
@@ -707,6 +711,7 @@
        DoIn("DESKTOP_ACCOUNTING_TIMEOUT", 30.0, DeskAccountTimeout, 0, NULL);
        diddeskaccount = 0;
      }
+
    EDBUG_RETURN_;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- main.c      15 Jun 2003 15:27:04 -0000      1.57
+++ main.c      10 Aug 2003 15:44:47 -0000      1.58
@@ -329,8 +329,6 @@
        ec->inroot = 1;
      }
 
-   if (mode.display_warp < 0)
-      mode.display_warp = 0;
    mode.startup = 0;
    /*  SC_Kill(); */
    /* ok - paranoia - save current settings to disk */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- settings.c  12 Jul 2003 15:04:32 -0000      1.72
+++ settings.c  10 Aug 2003 15:44:47 -0000      1.73
@@ -341,6 +341,8 @@
 static char         tmp_owner_popup_focus;
 static char         tmp_raise_focus;
 static char         tmp_warp_focus;
+
+#ifdef WITH_TARTY_WARP
 static char         tmp_warp_after_focus;
 static char         tmp_raise_after_focus;
 static char         tmp_display_warp;
@@ -348,6 +350,7 @@
 static char         tmp_warpshaded;
 static char         tmp_warpiconified;
 static char         tmp_warpfocused;
+#endif
 static char         tmp_clickalways;
 
 static void         CB_ConfigureFocus(int val, void *data);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/setup.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -3 -r1.90 -r1.91
--- setup.c     20 Jul 2003 18:02:16 -0000      1.90
+++ setup.c     10 Aug 2003 15:44:47 -0000      1.91
@@ -380,9 +380,6 @@
                SubstructureNotifyMask);
    XSync(disp, False);
    mode.xselect = 0;
-   /* Init XKB to pick up release of alt modifier */
-   WarpFocusInitEvents();
-   XSync(disp, False);
 
    /* warn, if necessary about X version problems */
    if (ProtocolVersion(disp) != 11)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/timestamp.h,v
retrieving revision 1.522
retrieving revision 1.523
diff -u -3 -r1.522 -r1.523
--- timestamp.h 8 Aug 2003 18:37:04 -0000       1.522
+++ timestamp.h 10 Aug 2003 15:44:47 -0000      1.523
@@ -1 +1 @@
-#define E_CHECKOUT_DATE "$Date: 2003/08/08 18:37:04 $"
+#define E_CHECKOUT_DATE "$Date: 2003/08/10 15:44:47 $"
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/warp.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- warp.c      22 May 2003 19:15:03 -0000      1.26
+++ warp.c      10 Aug 2003 15:44:47 -0000      1.27
@@ -38,80 +38,43 @@
 
 #include "E.h"
 
-#define XK_MISCELLANY
-#ifdef WITH_TARTY_WARP
-#include <X11/XKBlib.h>
-#endif
-#include <X11/keysymdef.h>
+static void         WarpFocusShowTitle(EWin * ewin);
+static void         WarpFocusHideTitle(void);
 
-static int          xkbEventNumber = -1;
-static int          warpFocusAltPressed = 0;
 static int          warpFocusIndex = 0;
 static char         warpFocusTitleShowing = 0;
 static Window       warpFocusTitleWindow = 0;
 static int          warptitles_num = 0;
 static Window      *warptitles = NULL;
 static EWin       **warptitles_ewin = NULL;
-
-void
-WarpFocusInitEvents(void)
-{
-   int                 xkbOpCode, xkbEventBase, xkbErrorBase;
-   int                 xkbMajor, xkbMinor;
-
-#ifdef WITH_TARTY_WARP
-   if (XkbQueryExtension
-       (disp, &xkbOpCode, &xkbEventBase, &xkbErrorBase, &xkbMajor, &xkbMinor))
-     {
-       xkbEventNumber = xkbEventBase + XkbEventCode;
-       XkbSelectEventDetails(disp, XkbUseCoreKbd, XkbStateNotify,
-                             XkbAllStateComponentsMask,
-                             XkbAllStateComponentsMask);
-     }
-   else
-      mode.display_warp = -1;
-#endif
-}
+static int          warpFocusKey = 0;
 
 int
 WarpFocusHandleEvent(XEvent * ev)
 {
    EDBUG(5, "WarpFocusHandleEvent");
-#ifdef WITH_TARTY_WARP
-   if ((!mode.display_warp) || (xkbEventNumber < 0))
-     {
-       EDBUG_RETURN(0);
-     }
-   if (ev->type == xkbEventNumber)
-     {
-       XkbEvent           *xev;
 
-       xev = (XkbEvent *) ev;
-       if (xev->any.xkb_type == XkbStateNotify)
-         {
-            XkbStateNotifyEvent *sn;
-            KeySym              keySym;
+   if (!mode.display_warp)
+      EDBUG_RETURN(0);
 
-            sn = &xev->state;
-            keySym = XKeycodeToKeysym(disp, sn->keycode, 0);
-            if ((keySym == XK_Alt_L) || (keySym == XK_Alt_R)
-                || (keySym == XK_Shift_L) || (keySym == XK_Shift_R)
-                || (keySym == XK_Control_L) || (keySym == XK_Control_R)
-                || (keySym == XK_Meta_L) || (keySym == XK_Meta_R)
-                || (keySym == XK_Super_L) || (keySym == XK_Super_R)
-                || (keySym == XK_Hyper_L) || (keySym == XK_Hyper_R))
-              {
-                 int                 newAltPressed;
+   if (ev->type != KeyPress && ev->type != KeyRelease)
+      EDBUG_RETURN(0);
 
-                 newAltPressed = (sn->event_type == KeyPress);
-                 if ((warpFocusAltPressed) && (!newAltPressed))
-                    WarpFocusFinish();
-                 warpFocusAltPressed = newAltPressed;
-              }
-         }
-       EDBUG_RETURN(1);
-     }
+#if 0
+   printf("WarpFocusHandleEvent win=%#x key=%#x(%#x) %d\n",
+         (unsigned)ev->xkey.window, ev->xkey.keycode,
+         warpFocusKey, warpFocusTitleShowing);
 #endif
+   if (warpFocusTitleShowing)
+     {
+       if (ev->xkey.keycode != warpFocusKey)
+          WarpFocusFinish();
+     }
+   else
+     {
+       warpFocusKey = ev->xkey.keycode;
+     }
+
    EDBUG_RETURN(0);
 }
 
@@ -122,10 +85,10 @@
    int                 i, num0, num;
 
    EDBUG(5, "WarpFocus");
-   if ((!mode.display_warp) || (xkbEventNumber < 0))
-     {
-       EDBUG_RETURN_;
-     }
+
+   if (!mode.display_warp)
+      EDBUG_RETURN_;
+
    lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING);
    if (!lst)
      {
@@ -157,7 +120,9 @@
        lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING);
        warpFocusIndex = num - 1;
      }
+
    ewin = NULL;
+
    if (lst)
      {
        warpFocusIndex = (warpFocusIndex + num + delta) % num;
@@ -179,6 +144,7 @@
        WarpFocusShowTitle(ewin);
        Efree(lst);
      }
+
    EDBUG_RETURN_;
 }
 
@@ -189,6 +155,7 @@
    int                 num;
 
    EDBUG(5, "WarpFocusFinish");
+
    lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING);
    if (lst)
      {
@@ -214,10 +181,11 @@
        Efree(lst);
        while (RemoveItem("", 0, LIST_FINDBY_NONE, LIST_TYPE_WARP_RING));
      }
+
    EDBUG_RETURN_;
 }
 
-void
+static void
 WarpFocusShowTitle(EWin * ewin)
 {
    TextClass          *tc;
@@ -234,12 +202,14 @@
       ic = FindItem("COORDS", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
    if ((!ic) || (!tc))
       return;
+
    if (!warpFocusTitleWindow)
       warpFocusTitleWindow = ECreateWindow(root.win, 0, 0, 1, 1, 1);
 
    pq = queue_up;
    queue_up = 0;
    XRaiseWindow(disp, warpFocusTitleWindow);
+
    if (!warpFocusTitleShowing)
      {
        EWin              **lst;
@@ -288,7 +258,15 @@
          }
        PropagateShapes(warpFocusTitleWindow);
        EMapWindow(disp, warpFocusTitleWindow);
+
+       /*
+        * Grab the keyboard. The grab is automatically released when
+        * WarpFocusHideTitle unmaps warpFocusTitleWindow.
+        */
+       XGrabKeyboard(disp, warpFocusTitleWindow, False, GrabModeAsync,
+                     GrabModeAsync, CurrentTime);
      }
+
    for (i = 0; i < warptitles_num; i++)
      {
        if (!FindItem
@@ -312,13 +290,14 @@
               }
          }
      }
+
    PropagateShapes(warpFocusTitleWindow);
    queue_up = pq;
    XFlush(disp);
    warpFocusTitleShowing = 1;
 }
 
-void
+static void
 WarpFocusHideTitle(void)
 {
    int                 i;
@@ -329,6 +308,7 @@
        for (i = 0; i < warptitles_num; i++)
           EDestroyWindow(disp, warptitles[i]);
      }
+
    if (warptitles)
       Efree(warptitles);
    if (warptitles_ewin)




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to