Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ewin-ops.c ewins.c focus.c menus.c mod-misc.c moveresize.c 
        settings.c 


Log Message:
No manual placement or sliding during startup.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.441
retrieving revision 1.442
diff -u -3 -r1.441 -r1.442
--- E.h 29 May 2005 10:20:25 -0000      1.441
+++ E.h 29 May 2005 14:59:16 -0000      1.442
@@ -909,6 +909,7 @@
    {
       char                manual;
       char                manual_mouse_pointer;
+      char                slidein;
       char                ignore_struts;
       char                raise_fullscreen;
    } place;
@@ -967,7 +968,6 @@
    int                 deskmode;
    int                 slidemode;
    char                cleanupslide;
-   char                mapslide;
    int                 slidespeedmap;
    int                 slidespeedcleanup;
    char                animate_shading;
@@ -1030,6 +1030,12 @@
    } move;
    struct
    {
+      char                enable_features;
+      char                doing_manual;
+      char                doing_slide;
+   } place;
+   struct
+   {
       char                utf8_int;    /* Use UTF-8 internally */
       char                utf8_loc;    /* Locale is UTF-8 */
    } text;
@@ -1057,7 +1063,6 @@
       char               *machine_name;
    } wm;
    int                 mode;
-   char                place;
    char                flipp;
    int                 resize_detail;
    int                 win_x, win_y, win_w, win_h;
@@ -1068,7 +1073,6 @@
    EWin               *mouse_over_ewin;
    EWin               *context_ewin;
    int                 px, py, x, y;
-   char                doingslide;
    int                 server_grabbed;
    int                 deskdrag;
    char                button_move_pending;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- ewin-ops.c  29 May 2005 10:20:25 -0000      1.44
+++ ewin-ops.c  29 May 2005 14:59:16 -0000      1.45
@@ -24,6 +24,7 @@
 #include "E.h"
 #include "ewin-ops.h"
 #include "snaps.h"
+#include <math.h>
 #include <sys/time.h>
 
 static const WinOp  winops[] = {
@@ -97,13 +98,17 @@
    char                firstlast;
 
    firstlast = 0;
-   Mode.doingslide = 1;
+   Mode.place.doing_slide = 1;
    FocusEnable(0);
    SoundPlay("SOUND_WINDOW_SLIDE");
 
    if (Conf.slidemode > 0)
       EGrabServer();
 
+   tmpx = abs(tx - fx) + abs(ty - fy);
+   tmpx = (tmpx > 0) ? (VRoot.w + VRoot.h) / tmpx : 100;
+   speed *= tmpx;
+
    ETimedLoopInit(0, 1024, speed);
    for (k = 0; k <= 1024;)
      {
@@ -124,7 +129,7 @@
    DrawEwinShape(ewin, Conf.slidemode, x, y, ewin->client.w, ewin->client.h, 
2);
    MoveEwin(ewin, tx, ty);
 
-   Mode.doingslide = 0;
+   Mode.place.doing_slide = 0;
    FocusEnable(1);
 
    if (Conf.slidemode > 0)
@@ -149,7 +154,7 @@
       goto done;
 
    firstlast = 0;
-   Mode.doingslide = 1;
+   Mode.place.doing_slide = 1;
    FocusEnable(0);
    SoundPlay("SOUND_WINDOW_SLIDE");
 
@@ -191,7 +196,7 @@
          }
      }
 
-   Mode.doingslide = 0;
+   Mode.place.doing_slide = 0;
    FocusEnable(1);
 
    if (Conf.slidemode > 0)
@@ -260,7 +265,7 @@
 doMoveResizeEwin(EWin * ewin, int desk, int x, int y, int w, int h, int flags)
 {
    static int          call_depth = 0;
-   int                 dx, dy, sw, sh, x0, y0, pdesk;
+   int                 dx, dy, sw, sh, xo, yo, pdesk;
    char                move, resize, reparent, raise, floating;
    EWin              **lst;
    int                 i, num;
@@ -320,15 +325,15 @@
        sh = VRoot.h;
        if (EoIsSticky(ewin))
          {
-            x0 = y0 = 0;
+            xo = yo = 0;
          }
        else
          {
             int                 ax, ay;
 
             DeskGetArea(desk, &ax, &ay);
-            x0 = -ax * sw;
-            y0 = -ay * sh;
+            xo = -ax * sw;
+            yo = -ay * sh;
             sw *= Conf.desks.areas_nx;
             sh *= Conf.desks.areas_ny;
          }
@@ -350,14 +355,14 @@
                dy = 8;
          }
 
-       if (x < x0 - EoGetW(ewin) + dx)
-          x = x0 - EoGetW(ewin) + dx;
-       else if (x > x0 + sw - dx)
-          x = x0 + sw - dx;
-       if (y < y0 - EoGetH(ewin) + dy)
-          y = y0 - EoGetH(ewin) + dy;
-       else if (y > y0 + sh - dy)
-          y = y0 + sh - dy;
+       if (x < xo - EoGetW(ewin) + dx)
+          x = xo - EoGetW(ewin) + dx;
+       else if (x > xo + sw - dx)
+          x = xo + sw - dx;
+       if (y < yo - EoGetH(ewin) + dy)
+          y = yo - EoGetH(ewin) + dy;
+       else if (y > yo + sh - dy)
+          y = yo + sh - dy;
      }
 
    if (flags & MRF_RAISE)
@@ -422,21 +427,18 @@
    else
       EoMoveResize(ewin, x, y, w, h);
 
-#if 1                          /* FIXME - Should be done when 
shading/unshading */
-   if (ewin->shaded == 0)
-     {
-       EMoveResizeWindow(ewin->win_container,
-                         ewin->border->border.left, ewin->border->border.top,
-                         ewin->client.w, ewin->client.h);
-     }
-   else
+   if (flags & MRF_RESIZE)
      {
-       EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
-     }
+       if (!ewin->shaded)
+          EMoveResizeWindow(ewin->win_container,
+                            ewin->border->border.left,
+                            ewin->border->border.top,
+                            ewin->client.w, ewin->client.h);
+#if 0
+       else
+          EMoveResizeWindow(ewin->win_container, -30, -30, 1, 1);
 #endif
 
-   if (flags & MRF_RESIZE)
-     {
        EMoveResizeWindow(ewin->client.win, 0, 0, ewin->client.w,
                          ewin->client.h);
        EwinBorderCalcSizes(ewin, 0);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- ewins.c     29 May 2005 10:20:25 -0000      1.68
+++ ewins.c     29 May 2005 14:59:16 -0000      1.69
@@ -598,11 +598,6 @@
        ewin->focusclick = 1;
      }
 
-   doslide = Conf.mapslide && !Mode.wm.startup;
-   /* if set for borderless then dont slide it in */
-   if ((!ewin->client.mwm_decor_title) && (!ewin->client.mwm_decor_border))
-      doslide = 0;
-
    ewin2 = NULL;
    if (ewin->client.transient)
      {
@@ -693,15 +688,20 @@
 
    ResizeEwin(ewin, ewin->client.w, ewin->client.h);
 
-   manplace = 0;
-   if ((!ewin->client.transient) && (Conf.place.manual)
-       && (!ewin->client.already_placed) && (!Mode.wm.startup) && 
(!Mode.place))
-     {
-       char                cangrab;
-
-       cangrab = GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
-       if (cangrab == GrabSuccess)
-          manplace = 1;
+   doslide = manplace = 0;
+   if (Mode.place.enable_features)
+     {
+       /* if set for borderless then dont slide it in */
+       if (Conf.place.slidein && !Mode.place.doing_slide &&
+           (ewin->client.mwm_decor_title || ewin->client.mwm_decor_border))
+          doslide = 1;
+
+       if (Conf.place.manual && !Mode.place.doing_manual &&
+           !ewin->client.already_placed && !ewin->client.transient)
+         {
+            if (GrabPointerSet(VRoot.win, ECSR_GRAB, 0) == GrabSuccess)
+               manplace = 1;
+         }
      }
 
    /* if it hasn't been placed yet.... find a spot for it */
@@ -770,12 +770,10 @@
        unsigned int        mask;
        Window              junk, root_return;
 
-#if 0                          /* FIXME: Disable for now */
        /* if the loser has manual placement on and the app asks to be on */
        /*  a desktop, then send E to that desktop so the user can place */
        /* the window there */
        DeskGoto(desk);
-#endif
 
        XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy,
                      &mask);
@@ -789,12 +787,12 @@
        ShowEwin(ewin);
        GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
        Mode.have_place_grab = 1;
-       Mode.place = 1;
+       Mode.place.doing_manual = 1;
        EoSetFloating(ewin, 1); /* Causes reparenting to root */
        ActionMoveStart(ewin, 1, 0, 0);
        goto done;
      }
-   else if ((doslide) && (!Mode.doingslide))
+   else if (doslide)
      {
        k = rand() % 4;
        if (k == 0)
@@ -817,6 +815,7 @@
             fx = VRoot.w;
             fy = (rand() % (VRoot.h)) - EoGetH(ewin);
          }
+       Mode.place.doing_slide = 1;
        FocusEnable(0);
        MoveEwinToDesktopAt(ewin, desk, fx, fy);
        ShowEwin(ewin);
@@ -876,11 +875,11 @@
 
    ActionsEnd(ewin);
 
-   if (Mode.doingslide)
+   if (Mode.place.doing_slide)
      {
        DrawEwinShape(ewin, Conf.slidemode, ewin->shape_x, ewin->shape_y,
                      ewin->client.w, ewin->client.h, 2);
-       Mode.doingslide = 0;
+       Mode.place.doing_slide = 0;
      }
 
    if (ewin == GetContextEwin())
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- focus.c     29 May 2005 10:20:25 -0000      1.98
+++ focus.c     29 May 2005 14:59:16 -0000      1.99
@@ -307,7 +307,7 @@
             if ((ewin2) && (Mode.focuswin == ewin2))
                do_follow = 2;
          }
-       else if (Mode.place)
+       else if (Mode.place.doing_manual)
          {
             do_follow = 1;
          }
@@ -420,6 +420,9 @@
    Mode.mouse_over_ewin = ewin;
 
    FocusToEWin(NULL, FOCUS_DESK_ENTER);
+
+   /* Enable window placement features */
+   Mode.place.enable_features = 1;
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.197
retrieving revision 1.198
diff -u -3 -r1.197 -r1.198
--- menus.c     28 May 2005 20:23:25 -0000      1.197
+++ menus.c     29 May 2005 14:59:17 -0000      1.198
@@ -340,6 +340,7 @@
        ewin->head = head_num;
 
        MoveEwinToDesktop(ewin, EoGetDesk(ewin));
+       ResizeEwin(ewin, ewin->client.w, ewin->client.h);
 
        if (Conf.menus.animate)
           EwinInstantShade(ewin, 0);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/mod-misc.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- mod-misc.c  3 May 2005 18:21:41 -0000       1.17
+++ mod-misc.c  29 May 2005 14:59:17 -0000      1.18
@@ -116,6 +116,7 @@
 
    CFG_ITEM_BOOL(Conf, place.manual, 0),
    CFG_ITEM_BOOL(Conf, place.manual_mouse_pointer, 0),
+   CFG_ITEM_BOOL(Conf, place.slidein, 0),
    CFG_ITEM_BOOL(Conf, place.ignore_struts, 0),
    CFG_ITEM_BOOL(Conf, place.raise_fullscreen, 0),
 
@@ -136,7 +137,6 @@
    CFG_ITEM_INT(Conf, deskmode, MODE_NONE),
    CFG_ITEM_INT(Conf, slidemode, 0),
    CFG_ITEM_BOOL(Conf, cleanupslide, 1),
-   CFG_ITEM_BOOL(Conf, mapslide, 0),
    CFG_ITEM_INT(Conf, slidespeedmap, 6000),
    CFG_ITEM_INT(Conf, slidespeedcleanup, 8000),
    CFG_ITEM_BOOL(Conf, animate_shading, 1),
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- moveresize.c        14 May 2005 19:40:34 -0000      1.41
+++ moveresize.c        29 May 2005 14:59:17 -0000      1.42
@@ -164,7 +164,7 @@
    Mode.nogroup = 0;
    Mode.move.swap = 0;
    Mode.have_place_grab = 0;
-   Mode.place = 0;
+   Mode.place.doing_manual = 0;
 
    ModulesSignal(ESIGNAL_MOVE_DONE, NULL);
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- settings.c  25 May 2005 22:57:38 -0000      1.136
+++ settings.c  29 May 2005 14:59:17 -0000      1.137
@@ -837,7 +837,7 @@
        Conf.menus.warp = tmp_warpmenus;
        Conf.menus.animate = tmp_animated_menus;
        Conf.menus.onscreen = tmp_menusonscreen;
-       Conf.mapslide = tmp_map_slide;
+       Conf.place.slidein = tmp_map_slide;
        Conf.cleanupslide = tmp_cleanup_slide;
        Conf.desks.slidein = tmp_desktop_slide;
        Conf.animate_shading = tmp_animate_shading;
@@ -868,7 +868,7 @@
    tmp_warpmenus = Conf.menus.warp;
    tmp_animated_menus = Conf.menus.animate;
    tmp_menusonscreen = Conf.menus.onscreen;
-   tmp_map_slide = Conf.mapslide;
+   tmp_map_slide = Conf.place.slidein;
    tmp_cleanup_slide = Conf.cleanupslide;
    tmp_desktop_slide = Conf.desks.slidein;
    tmp_animate_shading = Conf.animate_shading;




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