Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ewin-ops.c ewins.c focus.c 


Log Message:
Fix various window slidein issues.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.440
retrieving revision 1.441
diff -u -3 -r1.440 -r1.441
--- E.h 29 May 2005 09:34:57 -0000      1.440
+++ E.h 29 May 2005 10:20:25 -0000      1.441
@@ -1745,6 +1745,7 @@
 #define FOCUS_PREV        9
 #define FOCUS_CLICK      10
 
+void                FocusEnable(int on);
 void                FocusGetNextEwin(void);
 void                FocusGetPrevEwin(void);
 void                FocusEwinSetGrabs(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -3 -r1.43 -r1.44
--- ewin-ops.c  28 May 2005 22:07:13 -0000      1.43
+++ ewin-ops.c  29 May 2005 10:20:25 -0000      1.44
@@ -98,6 +98,7 @@
 
    firstlast = 0;
    Mode.doingslide = 1;
+   FocusEnable(0);
    SoundPlay("SOUND_WINDOW_SLIDE");
 
    if (Conf.slidemode > 0)
@@ -122,7 +123,9 @@
      }
    DrawEwinShape(ewin, Conf.slidemode, x, y, ewin->client.w, ewin->client.h, 
2);
    MoveEwin(ewin, tx, ty);
+
    Mode.doingslide = 0;
+   FocusEnable(1);
 
    if (Conf.slidemode > 0)
       EUngrabServer();
@@ -134,17 +137,20 @@
 SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins,
             int speed)
 {
-   int                 k, *x = NULL, *y = NULL, tmpx, tmpy, tmpw, tmph, i;
+   int                 k, *x, *y, tmpx, tmpy, tmpw, tmph, i;
    char                firstlast;
 
-   if (num_wins)
-     {
-       x = Emalloc(sizeof(int) * num_wins);
-       y = Emalloc(sizeof(int) * num_wins);
-     }
+   if (num_wins <= 0)
+      return;
+
+   x = Emalloc(sizeof(int) * num_wins);
+   y = Emalloc(sizeof(int) * num_wins);
+   if (!x || !y)
+      goto done;
 
    firstlast = 0;
    Mode.doingslide = 1;
+   FocusEnable(0);
    SoundPlay("SOUND_WINDOW_SLIDE");
 
    if (Conf.slidemode > 0)
@@ -186,11 +192,14 @@
      }
 
    Mode.doingslide = 0;
+   FocusEnable(1);
+
    if (Conf.slidemode > 0)
       EUngrabServer();
 
    SoundPlay("SOUND_WINDOW_SLIDE_END");
 
+ done:
    if (x)
       Efree(x);
    if (y)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- ewins.c     28 May 2005 11:43:57 -0000      1.67
+++ ewins.c     29 May 2005 10:20:25 -0000      1.68
@@ -42,6 +42,8 @@
    /* StructureNotifyMask | */ ResizeRedirectMask | \
    PropertyChangeMask | ColormapChangeMask | VisibilityChangeMask)
 
+static void         EwinSlideIn(int val __UNUSED__, void *data);
+
 static void         EwinChangesStart(EWin * ewin);
 static void         EwinChangesProcess(EWin * ewin);
 
@@ -815,10 +817,12 @@
             fx = VRoot.w;
             fy = (rand() % (VRoot.h)) - EoGetH(ewin);
          }
+       FocusEnable(0);
        MoveEwinToDesktopAt(ewin, desk, fx, fy);
        ShowEwin(ewin);
-       SlideEwinTo(ewin, fx, fy, x, y, Conf.slidespeedmap);
-       MoveEwinToDesktopAt(ewin, desk, x, y);
+       ewin->req_x = x;
+       ewin->req_y = y;
+       DoIn("Slide", 0.05, EwinSlideIn, 0, ewin);
      }
    else
      {
@@ -1518,6 +1522,19 @@
 }
 
 /*
+ * Slidein
+ */
+static void
+EwinSlideIn(int val __UNUSED__, void *data)
+{
+   EWin               *ewin = data;
+
+   SlideEwinTo(ewin, EoGetX(ewin), EoGetY(ewin), ewin->req_x, ewin->req_y,
+              Conf.slidespeedmap);
+   FocusEnable(1);
+}
+
+/*
  * Change requests
  */
 static struct
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- focus.c     25 May 2005 22:57:38 -0000      1.97
+++ focus.c     29 May 2005 10:20:25 -0000      1.98
@@ -23,9 +23,26 @@
  */
 #include "E.h"
 
-static int          focus_enable = 0;
+static int          focus_inhibit = 1;
 static int          focus_new_desk_nesting = 0;
 
+void
+FocusEnable(int on)
+{
+   if (on)
+     {
+       if (focus_inhibit > 0)
+          focus_inhibit--;
+     }
+   else
+     {
+       focus_inhibit++;
+     }
+
+   if (EventDebug(EDBUG_TYPE_FOCUS))
+      Eprintf("FocusEnable inhibit=%d\n", focus_inhibit);
+}
+
 /*
  * Return !0 if it is OK to focus ewin.
  * on_screen: Require window to be on-screen now
@@ -216,6 +233,9 @@
    int                 do_follow = 0;
    int                 do_raise = 0, do_warp = 0;
 
+   if (focus_inhibit)
+      return;
+
    if (EventDebug(EDBUG_TYPE_FOCUS))
      {
        if (ewin)
@@ -225,9 +245,6 @@
           Eprintf("FocusToEWin None why=%d\n", why);
      }
 
-   if (!focus_enable)
-      return;
-
    switch (why)
      {
      case FOCUS_NEXT:
@@ -272,10 +289,6 @@
        break;
 
      case FOCUS_EWIN_NEW:
-       /* Don't chase around after the windows at startup */
-       if (Mode.wm.startup || Mode.doingslide)
-          return;
-
        if (Conf.focus.all_new_windows_get_focus)
          {
             do_follow = 2;
@@ -400,7 +413,7 @@
    EWin               *ewin;
 
    /* Start focusing windows */
-   focus_enable = 1;
+   FocusEnable(1);
 
    /* Set the mouse-over window */
    ewin = GetEwinByCurrentPointer();
@@ -867,7 +880,7 @@
      {
      case ESIGNAL_START:
        /* Delay focusing a bit to allow things to settle down */
-       DoIn("FOCUS_INIT_TIMEOUT", 1., FocusInitTimeout, 0, NULL);
+       DoIn("FOCUS_INIT_TIMEOUT", 0.5, FocusInitTimeout, 0, NULL);
        break;
 
      case ESIGNAL_EXIT:




-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to