Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h arrange.c ewin-ops.c ewins.c icccm.c main.c moveresize.c 
        x.c zoom.c 


Log Message:
Fix move/resize problems.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.70
retrieving revision 1.314.2.71
diff -u -3 -r1.314.2.70 -r1.314.2.71
--- E.h 11 Dec 2004 15:51:33 -0000      1.314.2.70
+++ E.h 13 Dec 2004 21:29:08 -0000      1.314.2.71
@@ -2263,6 +2263,7 @@
 
 Window              ECreateWindow(Window parent, int x, int y, int w, int h,
                                  int saveunder);
+void                EWindowSync(Window win);
 void                EMoveWindow(Display * d, Window win, int x, int y);
 void                EResizeWindow(Display * d, Window win, int w, int h);
 void                EMoveResizeWindow(Display * d, Window win, int x, int y,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/arrange.c,v
retrieving revision 1.71.2.3
retrieving revision 1.71.2.4
diff -u -3 -r1.71.2.3 -r1.71.2.4
--- arrange.c   20 Oct 2004 21:04:04 -0000      1.71.2.3
+++ arrange.c   13 Dec 2004 21:29:09 -0000      1.71.2.4
@@ -1104,7 +1104,6 @@
                         {
                            SlideEwinTo(ewin, EoGetX(ewin), EoGetY(ewin),
                                        ret[i].x, ret[i].y, speed);
-                           ICCCM_Configure(ewin);
                         }
                    }
               }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewin-ops.c,v
retrieving revision 1.1.2.21
retrieving revision 1.1.2.22
diff -u -3 -r1.1.2.21 -r1.1.2.22
--- ewin-ops.c  9 Dec 2004 21:40:57 -0000       1.1.2.21
+++ ewin-ops.c  13 Dec 2004 21:29:09 -0000      1.1.2.22
@@ -254,14 +254,28 @@
    EMoveResizeWindow(disp, EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin),
                     EoGetW(ewin), EoGetH(ewin));
 
+   if (ewin->shaded == 0)
+     {
+       EMoveResizeWindow(disp, ewin->win_container,
+                         ewin->border->border.left, ewin->border->border.top,
+                         ewin->client.w, ewin->client.h);
+     }
+   else
+     {
+       EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
+     }
+
+   EMoveResizeWindow(disp, ewin->client.win, 0, 0,
+                    ewin->client.w, ewin->client.h);
+
+   EwinBorderCalcSizes(ewin);
+
 #if 0                          /* FIXME - Make configurable? */
-   if (Conf.(Mode.mode != MODE_MOVE_PENDING && Mode.mode != MODE_MOVE)
+   if ((Mode.mode != MODE_MOVE_PENDING && Mode.mode != MODE_MOVE)
        || (Mode.have_place_grab))
 #endif
       ICCCM_Configure(ewin);
 
-   EwinBorderCalcSizes(ewin);
-
    if (move)
      {
        lst = EwinListTransients(ewin, &num, 0);
@@ -538,7 +552,8 @@
        d = EoGetX(ewin) + EoGetW(ewin) - b;
        ewin->shaded = 2;
        EoSetW(ewin, b);
-       EoSetX(ewin, d);
+       if (!Mode.wm.startup)
+          EoSetX(ewin, d);
        EMoveResizeWindow(disp, EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin),
                          EoGetW(ewin), EoGetH(ewin));
        EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
@@ -566,7 +581,8 @@
        d = EoGetY(ewin) + EoGetH(ewin) - b;
        ewin->shaded = 2;
        EoSetH(ewin, b);
-       EoSetY(ewin, d);
+       if (!Mode.wm.startup)
+          EoSetY(ewin, d);
        EMoveResizeWindow(disp, EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin),
                          EoGetW(ewin), EoGetH(ewin));
        EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
@@ -592,12 +608,14 @@
    char                pq;
 
    EDBUG(4, "EwinInstantUnShade");
+
    if (GetZoomEWin() == ewin)
       EDBUG_RETURN_;
    if (!ewin->shaded)
       EDBUG_RETURN_;
    pq = Mode.queue_up;
    Mode.queue_up = 0;
+
    switch (ewin->border->shadedir)
      {
      case 0:
@@ -936,6 +954,7 @@
        EMoveResizeWindow(disp, ewin->win_container,
                          ewin->border->border.left, ewin->border->border.top,
                          1, ewin->client.h);
+       EWindowSync(ewin->client.win);  /* Gravity - recache */
        EMoveResizeWindow(disp, ewin->client.win, -ewin->client.w, 0,
                          ewin->client.w, ewin->client.h);
        EMapWindow(disp, ewin->client.win);
@@ -986,6 +1005,7 @@
        EMoveResizeWindow(disp, ewin->win_container,
                          ewin->border->border.left, ewin->border->border.top,
                          1, ewin->client.h);
+       EWindowSync(ewin->client.win);  /* Gravity - recache */
        EMoveResizeWindow(disp, ewin->client.win, 0, 0, ewin->client.w,
                          ewin->client.h);
        EMapWindow(disp, ewin->client.win);
@@ -1032,6 +1052,7 @@
        EMoveResizeWindow(disp, ewin->win_container,
                          ewin->border->border.left, ewin->border->border.top,
                          ewin->client.w, 1);
+       EWindowSync(ewin->client.win);  /* Gravity - recache */
        EMoveResizeWindow(disp, ewin->client.win, 0, -ewin->client.h,
                          ewin->client.w, ewin->client.h);
        EMapWindow(disp, ewin->client.win);
@@ -1084,6 +1105,7 @@
        EMoveResizeWindow(disp, ewin->win_container,
                          ewin->border->border.left, ewin->border->border.top,
                          ewin->client.w, 1);
+       EWindowSync(ewin->client.win);  /* Gravity - recache */
        EMoveResizeWindow(disp, ewin->client.win, 0, 0, ewin->client.w,
                          ewin->client.h);
        EMapWindow(disp, ewin->client.win);
@@ -1614,7 +1636,6 @@
 {
    MoveEwinToDesktop(ewin, desk);
    RaiseEwin(ewin);
-   ICCCM_Configure(ewin);
    EoSetSticky(ewin, 0);
    RememberImportantInfoForEwin(ewin);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewins.c,v
retrieving revision 1.1.2.34
retrieving revision 1.1.2.35
diff -u -3 -r1.1.2.34 -r1.1.2.35
--- ewins.c     9 Dec 2004 21:40:57 -0000       1.1.2.34
+++ ewins.c     13 Dec 2004 21:29:09 -0000      1.1.2.35
@@ -56,7 +56,7 @@
 }
 
 static EWin        *
-EwinCreate(Window win)
+EwinCreate(Window win, int type)
 {
    EWin               *ewin;
    XSetWindowAttributes att;
@@ -65,6 +65,7 @@
 
    ewin = Ecalloc(1, sizeof(EWin));
 
+   ewin->type = type;
    ewin->state = (Mode.wm.startup) ? EWIN_STATE_STARTUP : EWIN_STATE_NEW;
    ewin->lx = -1;
    ewin->ly = -1;
@@ -141,6 +142,12 @@
    ERegisterWindow(ewin->client.win);
    EventCallbackRegister(ewin->client.win, 0, EwinHandleEventsClient, ewin);
 
+   if (!EwinIsInternal(ewin))
+     {
+       XSetWindowBorderWidth(disp, win, 0);
+       ewin->client.bw = 0;
+     }
+
    ModulesSignal(ESIGNAL_EWIN_CREATE, ewin);
 
    EDBUG_RETURN(ewin);
@@ -492,6 +499,15 @@
       PropagateShapes(EoGetWin(ewin));
 }
 
+static void
+EwinAdopt(EWin * ewin)
+{
+   /* We must reparent after getting original window position */
+   EReparentWindow(disp, ewin->client.win, ewin->win_container, 0, 0);
+   XMoveWindow(disp, ewin->client.win, 0, 0);
+   ICCCM_Adopt(ewin);
+}
+
 static EWin        *
 Adopt(Window win)
 {
@@ -500,7 +516,7 @@
    EDBUG(4, "Adopt");
 
    ecore_x_grab();
-   ewin = EwinCreate(win);
+   ewin = EwinCreate(win, EWIN_TYPE_NORMAL);
 
    ICCCM_AdoptStart(ewin);
    ICCCM_GetTitle(ewin, 0);
@@ -518,7 +534,8 @@
    if (Mode.wm.startup)
       ICCCM_GetEInfo(ewin);
    ICCCM_MatchSize(ewin);
-   ICCCM_Adopt(ewin);
+
+   EwinAdopt(ewin);
 
    EwinBorderSelect(ewin);
    EwinBorderSetTo(ewin, NULL);
@@ -545,10 +562,9 @@
    EDBUG(4, "AdoptInternal");
 
    ecore_x_grab();
-   ewin = EwinCreate(win);
+   ewin = EwinCreate(win, type);
 
    ewin->border = border;
-   ewin->type = type;
    switch (type)
      {
      case EWIN_TYPE_DIALOG:
@@ -598,7 +614,8 @@
      }
    MatchEwinToSnapInfo(ewin);
    ICCCM_MatchSize(ewin);
-   ICCCM_Adopt(ewin);
+
+   EwinAdopt(ewin);
 
    EwinBorderSelect(ewin);
    EwinBorderSetTo(ewin, NULL);
@@ -857,7 +874,6 @@
        ewin->client.already_placed = 1;
        x = Mode.x + 1;
        y = Mode.y + 1;
-       ICCCM_Configure(ewin);
        EwinBorderDraw(ewin, 1, 0);
        MoveEwinToDesktop(ewin, EoGetDesk(ewin));
        RaiseEwin(ewin);
@@ -867,7 +883,6 @@
        GrabPointerSet(VRoot.win, ECSR_GRAB, 0);
        Mode.have_place_grab = 1;
        Mode.place = 1;
-       ICCCM_Configure(ewin);
        ecore_x_ungrab();
        EoSetFloating(ewin, 1); /* Causes reparenting to root */
        ActionMoveStart(ewin, 1, 0, 0);
@@ -913,9 +928,6 @@
        ShowEwin(ewin);
      }
 
-   /* send synthetic configure notifies and configure the window */
-   ICCCM_Configure(ewin);
-
    EwinDetermineArea(ewin);
    ecore_x_ungrab();
 
@@ -946,7 +958,6 @@
    if (init)
       init(ewin, ptr);         /* Type specific initialisation */
 
-   ICCCM_Configure(ewin);
    EwinBorderDraw(ewin, 1, 1);
 
    EwinDetermineArea(ewin);
@@ -1141,8 +1152,7 @@
        Mode.move.check = 0;    /* Don't restrict client requests */
        MoveResizeEwin(ewin, x, y, w, h);
        Mode.move.check = 1;
-       if (Mode.mode == MODE_MOVE_PENDING || Mode.mode == MODE_MOVE)
-          ICCCM_Configure(ewin);
+
        {
           char                pshaped;
 
@@ -1731,6 +1741,7 @@
           continue;
 
        /* This makes E determine the client window stacking at exit */
+       EwinInstantUnShade(ewin);
        EReparentWindow(disp, ewin->client.win, VRoot.win,
                        ewin->client.x, ewin->client.y);
      }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.76.2.16
retrieving revision 1.76.2.17
diff -u -3 -r1.76.2.16 -r1.76.2.17
--- icccm.c     8 Dec 2004 20:06:16 -0000       1.76.2.16
+++ icccm.c     13 Dec 2004 21:29:10 -0000      1.76.2.17
@@ -300,45 +300,22 @@
 ICCCM_Configure(EWin * ewin)
 {
    XEvent              ev;
-   XWindowChanges      xwc;
    int                 d;
    Window              child;
 
    EDBUG(6, "ICCCM_Configure");
 
-   d = EoGetDesk(ewin);
-
-   if (ewin->shaded == 0)
-     {
-       xwc.x = ewin->border->border.left;
-       xwc.y = ewin->border->border.top;
-       xwc.width = ewin->client.w;
-       xwc.height = ewin->client.h;
-       XConfigureWindow(disp, ewin->win_container,
-                        CWX | CWY | CWWidth | CWHeight, &xwc);
-     }
-   else
-     {
-       xwc.x = -30;
-       xwc.y = -30;
-       xwc.width = 1;
-       xwc.height = 1;
-       XConfigureWindow(disp, ewin->win_container,
-                        CWX | CWY | CWWidth | CWHeight, &xwc);
-       xwc.width = ewin->client.w;
-       xwc.height = ewin->client.h;
-     }
-   xwc.x = 0;
-   xwc.y = 0;
-   XConfigureWindow(disp, ewin->client.win, CWX | CWY | CWWidth | CWHeight,
-                   &xwc);
-   if ((ewin->type == EWIN_TYPE_MENU) || (ewin->type == EWIN_TYPE_DIALOG))
+   if (EwinIsInternal(ewin))
       EDBUG_RETURN_;
 
+   XMoveResizeWindow(disp, ewin->client.win, 0, 0,
+                    ewin->client.w, ewin->client.h);
+
    ev.type = ConfigureNotify;
    ev.xconfigure.display = disp;
    ev.xconfigure.event = ewin->client.win;
    ev.xconfigure.window = ewin->client.win;
+   d = EoGetDesk(ewin);
    ev.xconfigure.x = DeskGetX(d) + ewin->client.x;
    ev.xconfigure.y = DeskGetY(d) + ewin->client.y;
    if (Mode.wm.window)
@@ -369,14 +346,6 @@
 {
    Window              win = ewin->client.win;
 
-   if (!EwinIsInternal(ewin))
-     {
-       XSetWindowBorderWidth(disp, win, 0);
-       ewin->client.bw = 0;
-     }
-
-   EReparentWindow(disp, win, ewin->win_container, 0, 0);
-
    if (ewin->client.start_iconified)
       ecore_x_icccm_state_set_iconic(win);
    else
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.99.2.30
retrieving revision 1.99.2.31
diff -u -3 -r1.99.2.30 -r1.99.2.31
--- main.c      5 Dec 2004 12:27:33 -0000       1.99.2.30
+++ main.c      13 Dec 2004 21:29:10 -0000      1.99.2.31
@@ -319,9 +319,6 @@
        GrabPointerRelease();
        XAllowEvents(disp, AsyncBoth, CurrentTime);
 
-       /* This mechanism is only needed when the SM is unavailable: */
-       ICCCM_SetEInfoOnAll();
-
        /* XSetInputFocus(disp, None, RevertToParent, CurrentTime); */
        /* I think this is a better way to release the grabs: (felix) */
        XSetInputFocus(disp, PointerRoot, RevertToPointerRoot, CurrentTime);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.22.2.15
retrieving revision 1.22.2.16
diff -u -3 -r1.22.2.15 -r1.22.2.16
--- moveresize.c        28 Nov 2004 17:51:34 -0000      1.22.2.15
+++ moveresize.c        13 Dec 2004 21:29:10 -0000      1.22.2.16
@@ -154,7 +154,6 @@
          }
 
        RaiseEwin(gwins[i]);
-       ICCCM_Configure(gwins[i]);
      }
    StackDesktop(EoGetDesk(ewin));      /* Restack to "un-float" */
 
@@ -385,7 +384,6 @@
                 ewin->client.w, ewin->client.h, 2);
    for (i = 0; i < ewin->border->num_winparts; i++)
       ewin->bits[i].no_expose = 1;
-   ICCCM_Configure(ewin);
 
    ecore_x_sync();
    if (Conf.resizemode > 0)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.71.2.16
retrieving revision 1.71.2.17
diff -u -3 -r1.71.2.16 -r1.71.2.17
--- x.c 11 Dec 2004 15:51:36 -0000      1.71.2.16
+++ x.c 13 Dec 2004 21:29:10 -0000      1.71.2.17
@@ -281,6 +281,10 @@
    xid = EXidFind(win);
    if (xid)
      {
+#if 0
+       Eprintf("EMoveWindow: %p %#lx: %d,%d %dx%d -> %d,%d\n",
+               xid, xid->win, xid->x, xid->y, xid->w, xid->h, x, y);
+#endif
        if ((x != xid->x) || (y != xid->y))
          {
             xid->x = x;
@@ -320,6 +324,10 @@
    xid = EXidFind(win);
    if (xid)
      {
+#if 0
+       Eprintf("EMoveResizeWindow: %p %#lx: %d,%d %dx%d -> %d,%d %dx%d\n",
+               xid, xid->win, xid->x, xid->y, xid->w, xid->h, x, y, w, h);
+#endif
        if ((w != xid->w) || (h != xid->h) || (x != xid->x) || (y != xid->y))
          {
             xid->x = x;
@@ -366,6 +374,30 @@
 }
 
 void
+EWindowSync(Window win)
+{
+   EXID               *xid;
+   Window              rr;
+   int                 x, y;
+   unsigned int        w, h, bw, depth;
+
+   xid = EXidFind(win);
+   if (!xid)
+      return;
+
+   XGetGeometry(disp, win, &rr, &x, &y, &w, &h, &bw, &depth);
+#if 0
+   Eprintf("EWindowSync: %p %#lx: %d,%d %dx%d -> %d,%d %dx%d\n",
+          xid, xid->win, xid->x, xid->y, xid->w, xid->h, x, y, w, h);
+#endif
+   xid->x = x;
+   xid->y = y;
+   xid->w = w;
+   xid->h = h;
+   xid->depth = depth;
+}
+
+void
 ERegisterWindow(Window win)
 {
    EXID               *xid;
@@ -378,6 +410,9 @@
       return;
 
    XGetGeometry(disp, win, &rr, &x, &y, &w, &h, &bw, &depth);
+#if 0
+   Eprintf("ERegisterWindow %#lx %d+%d %dx%d\n", win, x, y, w, h);
+#endif
    xid = EXidSet(win, None, x, y, w, h, depth);
    xid->attached = 1;
 }
@@ -617,6 +652,11 @@
    xid = EXidFind(win);
    if (xid)
      {
+#if 0
+       Eprintf("EReparentWindow: %p %#lx: %#lx->%#lx %d,%d %dx%d -> %d,%d\n",
+               xid, xid->win, xid->parent, parent, xid->x, xid->y, xid->w,
+               xid->h, x, y);
+#endif
        if (parent == xid->parent)
          {
             if ((x != xid->x) || (y != xid->y))
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/zoom.c,v
retrieving revision 1.23.2.2
retrieving revision 1.23.2.3
diff -u -3 -r1.23.2.2 -r1.23.2.3
--- zoom.c      17 Oct 2004 08:47:26 -0000      1.23.2.2
+++ zoom.c      13 Dec 2004 21:29:10 -0000      1.23.2.3
@@ -206,7 +206,6 @@
             ewin = zoom_last_ewin;
 /*           XUngrabPointer(disp, CurrentTime); */
             MoveEwin(ewin, zoom_last_x, zoom_last_y);
-            ICCCM_Configure(ewin);
             if (zoom_mask_1)
                EDestroyWindow(disp, zoom_mask_1);
             if (zoom_mask_2)
@@ -247,7 +246,6 @@
        RaiseEwin(ewin);
        MoveEwin(ewin, -ewin->border->border.left + x1,
                 -ewin->border->border.top + y1);
-       ICCCM_Configure(ewin);
        FocusToEWin(ewin, FOCUS_SET);
        XWarpPointer(disp, None, ewin->client.win, 0, 0, 0, 0,
                     ewin->client.w / 2, ewin->client.h / 2);




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to