Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewins.c ewins.h ewmh.c 


Log Message:
Center unplaced dialogs on "parent"(if transient) or root.

===================================================================
RCS file: /cvs/e/e16/e/src/ewins.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -3 -r1.174 -r1.175
--- ewins.c     8 Oct 2006 14:54:20 -0000       1.174
+++ ewins.c     26 Oct 2006 20:25:30 -0000      1.175
@@ -835,7 +835,6 @@
             EQueryPointer(NULL, &rx, &ry, NULL, NULL);
             Mode.events.x = rx;
             Mode.events.y = ry;
-            ewin->state.placed = 1;
 
             /* try to center the window on the mouse pointer */
             newWinX = rx;
@@ -855,11 +854,23 @@
             x = newWinX;
             y = newWinY;
          }
+       else if (ewin->ewmh.type.b.dialog)
+         {
+            /* Center unplaced dialogs on parent(if transient) or root */
+            Win                 parent;
+
+            ewin2 = NULL;
+            if (EwinGetTransientFor(ewin) != None)
+               ewin2 = EwinFindByClient(EwinGetTransientFor(ewin));
+            parent = (ewin2) ? EoGetWin(ewin) : VRoot.win;
+            x = (WinGetW(parent) - EoGetW(ewin)) / 2;
+            y = (WinGetH(parent) - EoGetH(ewin)) / 2;
+         }
        else
          {
-            ewin->state.placed = 1;
             ArrangeEwinXY(ewin, &x, &y);
          }
+       ewin->state.placed = 1;
      }
 
    /* if the window asked to be iconified at the start */
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- ewins.h     23 Aug 2006 19:06:21 -0000      1.56
+++ ewins.h     26 Oct 2006 20:25:30 -0000      1.57
@@ -205,6 +205,21 @@
       XID                 sync_request_counter;
       long long           sync_request_count;
 #endif
+      union
+      {
+        unsigned char       all;
+        struct
+        {
+           unsigned            desktop:1;
+           unsigned            dock:1;
+           unsigned            toolbar:1;
+           unsigned            menu:1;
+           unsigned            utility:1;
+           unsigned            splash:1;
+           unsigned            dialog:1;
+           unsigned            normal:1;
+        } b;
+      } type;
    } ewmh;
    struct
    {
===================================================================
RCS file: /cvs/e/e16/e/src/ewmh.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -3 -r1.106 -r1.107
--- ewmh.c      7 Aug 2006 20:20:15 -0000       1.106
+++ ewmh.c      26 Oct 2006 20:25:30 -0000      1.107
@@ -564,11 +564,19 @@
    Ecore_X_Atom       *p_atoms, atom;
    int                 n_atoms;
 
+   ewin->ewmh.type.all = 0;
+
    n_atoms = ecore_x_window_prop_atom_list_get(EwinGetClientXwin(ewin),
                                               ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
                                               &p_atoms);
    if (n_atoms <= 0)
-      return;
+     {
+       if (EwinIsTransient(ewin))
+          ewin->ewmh.type.b.dialog = 1;
+       else
+          ewin->ewmh.type.b.normal = 1;
+       return;
+     }
 
    atom = p_atoms[0];
    if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP)
@@ -581,6 +589,7 @@
        EwinInhSetUser(ewin, size, 1);
        ewin->props.donthide = 1;
        ewin->props.no_border = 1;
+       ewin->ewmh.type.b.desktop = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK)
      {
@@ -589,6 +598,7 @@
        ewin->props.skip_focuslist = 1;
        EoSetSticky(ewin, 1);
        ewin->props.donthide = 1;
+       ewin->ewmh.type.b.dock = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY)
      {
@@ -598,24 +608,28 @@
        ewin->props.skip_focuslist = 1;
        ewin->props.never_use_area = 1;
        ewin->props.donthide = 1;
+       ewin->ewmh.type.b.utility = 1;
      }
-#if 0                          /* Not used by E (yet?) */
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR)
      {
+       ewin->ewmh.type.b.toolbar = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU)
      {
+       ewin->ewmh.type.b.menu = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH)
      {
+       ewin->ewmh.type.b.splash = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG)
      {
+       ewin->ewmh.type.b.dialog = 1;
      }
    else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL)
      {
+       ewin->ewmh.type.b.normal = 1;
      }
-#endif
    Efree(p_atoms);
 }
 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to