Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ecore-e16.c ecore-e16.h ewin-ops.c ewins.c ewmh.c 


Log Message:
Handle _NET_MOVERESIZE_WINDOW.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.463
retrieving revision 1.464
diff -u -3 -r1.463 -r1.464
--- E.h 9 Jul 2005 16:42:26 -0000       1.463
+++ E.h 10 Jul 2005 00:23:52 -0000      1.464
@@ -1616,6 +1616,8 @@
 EWin               *GetFocusEwin(void);
 EWin               *GetContextEwin(void);
 void                SetContextEwin(EWin * ewin);
+void                EwinGetPosition(const EWin * ewin, int x, int y, int bw,
+                                   int grav, int *px, int *py);
 void                EwinUpdateShapeInfo(EWin * ewin);
 void                EwinPropagateShapes(EWin * ewin);
 void                EwinStateUpdate(EWin * ewin);
@@ -1646,6 +1648,8 @@
 void                MoveEwin(EWin * ewin, int x, int y);
 void                ResizeEwin(EWin * ewin, int w, int h);
 void                MoveResizeEwin(EWin * ewin, int x, int y, int w, int h);
+void                MoveResizeEwinWithGravity(EWin * ewin, int x, int y, int w,
+                                             int h, int grav);
 void                EwinIconify(EWin * ewin);
 void                EwinDeIconify(EWin * ewin);
 void                EwinStick(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecore-e16.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ecore-e16.c 30 Jun 2005 12:09:34 -0000      1.15
+++ ecore-e16.c 10 Jul 2005 00:23:52 -0000      1.16
@@ -860,10 +860,10 @@
 
 /* Misc window ops */
 Ecore_X_Atom        ECORE_X_ATOM_NET_CLOSE_WINDOW;
+Ecore_X_Atom        ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
 Ecore_X_Atom        ECORE_X_ATOM_NET_WM_MOVERESIZE;
 
 #if 0                          /* Not yet implemented */
-Ecore_X_Atom        ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
 Ecore_X_Atom        ECORE_X_ATOM_NET_RESTACK_WINDOW;
 Ecore_X_Atom        ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS;
 #endif
@@ -974,10 +974,10 @@
    ECORE_X_ATOM_NET_WM_WINDOW_OPACITY = _ATOM_GET("_NET_WM_WINDOW_OPACITY");
 
    ECORE_X_ATOM_NET_CLOSE_WINDOW = _ATOM_GET("_NET_CLOSE_WINDOW");
+   ECORE_X_ATOM_NET_MOVERESIZE_WINDOW = _ATOM_GET("_NET_MOVERESIZE_WINDOW");
    ECORE_X_ATOM_NET_WM_MOVERESIZE = _ATOM_GET("_NET_WM_MOVERESIZE");
 
 #if 0                          /* Not yet implemented */
-   ECORE_X_ATOM_NET_MOVERESIZE_WINDOW = _ATOM_GET("_NET_MOVERESIZE_WINDOW");
    ECORE_X_ATOM_NET_RESTACK_WINDOW = _ATOM_GET("_NET_RESTACK_WINDOW");
    ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS =
       _ATOM_GET("_NET_REQUEST_FRAME_EXTENTS");
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecore-e16.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ecore-e16.h 30 Jun 2005 12:09:34 -0000      1.11
+++ ecore-e16.h 10 Jul 2005 00:23:52 -0000      1.12
@@ -193,10 +193,10 @@
 
 /* Misc window ops */
 extern Ecore_X_Atom ECORE_X_ATOM_NET_CLOSE_WINDOW;
+extern Ecore_X_Atom ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
 extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_MOVERESIZE;
 
 #if 0                          /* Not yet implemented */
-extern Ecore_X_Atom ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
 extern Ecore_X_Atom ECORE_X_ATOM_NET_RESTACK_WINDOW;
 extern Ecore_X_Atom ECORE_X_ATOM_NET_REQUEST_FRAME_EXTENTS;
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- ewin-ops.c  8 Jul 2005 16:48:06 -0000       1.51
+++ ewin-ops.c  10 Jul 2005 00:23:52 -0000      1.52
@@ -519,6 +519,13 @@
 }
 
 void
+MoveResizeEwinWithGravity(EWin * ewin, int x, int y, int w, int h, int grav)
+{
+   EwinGetPosition(ewin, x, y, ewin->client.bw, grav, &x, &y);
+   doMoveResizeEwin(ewin, 0, x, y, w, h, MRF_MOVE | MRF_RESIZE);
+}
+
+void
 MoveEwinToDesktop(EWin * ewin, int desk)
 {
    doMoveResizeEwin(ewin, desk, 0, 0, 0, 0, MRF_DESK);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- ewins.c     9 Jul 2005 17:36:33 -0000       1.84
+++ ewins.c     10 Jul 2005 00:23:52 -0000      1.85
@@ -395,18 +395,16 @@
 /*
  * Derive frame window position from client window and border properties
  */
-static void
-EwinGetPosition(const EWin * ewin, int *px, int *py)
+void
+EwinGetPosition(const EWin * ewin, int x, int y, int bw, int grav,
+               int *px, int *py)
 {
-   int                 x, y, bw, frame_lr, frame_tb;
+   int                 bd_lr, bd_tb;
 
-   x = ewin->client.x;
-   y = ewin->client.y;
-   bw = ewin->client.bw;
-   frame_lr = ewin->border->border.left + ewin->border->border.right;
-   frame_tb = ewin->border->border.top + ewin->border->border.bottom;
+   bd_lr = ewin->border->border.left + ewin->border->border.right;
+   bd_tb = ewin->border->border.top + ewin->border->border.bottom;
 
-   switch (ewin->client.grav)
+   switch (grav)
      {
      case NorthWestGravity:
      case SouthWestGravity:
@@ -416,12 +414,12 @@
      case NorthEastGravity:
      case EastGravity:
      case SouthEastGravity:
-       x -= frame_lr / 2;
+       x -= bd_lr;
        break;
      case NorthGravity:
      case CenterGravity:
      case SouthGravity:
-       x -= frame_lr - bw;
+       x -= bd_lr - bw;
        break;
      case StaticGravity:
        x -= ewin->border->border.left;
@@ -430,7 +428,7 @@
        break;
      }
 
-   switch (ewin->client.grav)
+   switch (grav)
      {
      case NorthWestGravity:
      case NorthGravity:
@@ -440,12 +438,12 @@
      case WestGravity:
      case CenterGravity:
      case EastGravity:
-       y -= frame_tb / 2;
+       y -= bd_tb;
        break;
      case SouthWestGravity:
      case SouthGravity:
      case SouthEastGravity:
-       y -= frame_tb - bw;
+       y -= bd_tb - bw;
        break;
      case StaticGravity:
        y -= ewin->border->border.top;
@@ -466,7 +464,8 @@
 {
    int                 x, y, l, r, t, b;
 
-   EwinGetPosition(ewin, &x, &y);
+   EwinGetPosition(ewin, ewin->client.x, ewin->client.y, ewin->client.bw,
+                  ewin->client.grav, &x, &y);
 
    l = ewin->border->border.left;
    r = ewin->border->border.right;
@@ -1124,9 +1123,8 @@
        if (ev->xconfigurerequest.value_mask & (CWX | CWY))
          {
             /* Correct position taking gravity into account */
-            ewin->client.x = x;
-            ewin->client.y = y;
-            EwinGetPosition(ewin, &x, &y);
+            EwinGetPosition(ewin, x, y, ewin->client.bw, ewin->client.grav,
+                            &x, &y);
          }
 
        Mode.move.check = 0;    /* Don't restrict client requests */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- ewmh.c      9 Jul 2005 10:15:18 -0000       1.78
+++ ewmh.c      10 Jul 2005 00:23:52 -0000      1.79
@@ -114,6 +114,7 @@
    atom_list[atom_count++] = ECORE_X_ATOM_NET_CLIENT_LIST_STACKING;
 
    atom_list[atom_count++] = ECORE_X_ATOM_NET_CLOSE_WINDOW;
+   atom_list[atom_count++] = ECORE_X_ATOM_NET_MOVERESIZE_WINDOW;
    atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_MOVERESIZE;
 
    atom_list[atom_count++] = ECORE_X_ATOM_NET_WM_NAME;
@@ -1002,6 +1003,20 @@
             EWMH_SetWindowState(ewin);
          }
      }
+   else if (ev->message_type == ECORE_X_ATOM_NET_MOVERESIZE_WINDOW)
+     {
+       int                 flags, grav, x, y, w, h;
+
+       flags = ev->data.l[0];
+       grav = flags & 0xf;
+       if (grav == 0)
+          grav = ewin->client.grav;
+       x = (flags & 0x100) ? ev->data.l[1] : EoGetX(ewin);
+       y = (flags & 0x200) ? ev->data.l[2] : EoGetY(ewin);
+       w = (flags & 0x400) ? ev->data.l[3] : ewin->client.w;
+       h = (flags & 0x800) ? ev->data.l[4] : ewin->client.h;
+       MoveResizeEwinWithGravity(ewin, x, y, w, h, grav);
+     }
    else if (ev->message_type == ECORE_X_ATOM_NET_WM_MOVERESIZE)
      {
        switch (ev->data.l[2])




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to