Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewin-ops.c ewins.c ewins.h hints.c size.c 


Log Message:
Change window restart property to include only state not available elsewhere.
Fix various fullscreen/maximized state bugs wrt. restart and locking.

===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- ewin-ops.c  30 Oct 2005 19:40:49 -0000      1.72
+++ ewin-ops.c  2 Nov 2005 23:03:02 -0000       1.73
@@ -1282,23 +1282,17 @@
 
    if (on)
      {
-       ewin->lx = EoGetX(ewin);
-       ewin->ly = EoGetY(ewin);
-       ewin->lw = ewin->client.w;
-       ewin->lh = ewin->client.h;
-       ewin->ll = EoGetLayer(ewin);
-       if (on > 1)
-         {
-            /* Fullscreen at startup */
-            x = EoGetX(ewin);
-            y = EoGetY(ewin);
-            w = ewin->client.w;
-            h = ewin->client.h;
-         }
-       else
+       if (on == 1)
          {
-            ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
+            if (ewin->state.inhibit_fullscreeen)
+               return;
+            ewin->lx = EoGetX(ewin);
+            ewin->ly = EoGetY(ewin);
+            ewin->lw = ewin->client.w;
+            ewin->lh = ewin->client.h;
+            ewin->ll = EoGetLayer(ewin);
          }
+       ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
 
        /* Fixup if available space doesn't match ICCCM size constraints */
        ICCCM_SizeMatch(ewin, w, h, &ww, &hh);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -3 -r1.123 -r1.124
--- ewins.c     30 Oct 2005 19:40:49 -0000      1.123
+++ ewins.c     2 Nov 2005 23:03:03 -0000       1.124
@@ -176,25 +176,37 @@
    Window              frame;
    XWindowAttributes   win_attr;
 
+   if (ewin->client.w <= 0)
+      ewin->client.w = 100;
+   if (ewin->client.h <= 0)
+      ewin->client.h = 100;
+
    if (ewin->client.argb && Conf.argb_client_mode > 0)
      {
        if (!XGetWindowAttributes(disp, _EwinGetClientXwin(ewin), &win_attr))
           return;
-       frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
+       frame =
+          ECreateVisualWindow(VRoot.win, ewin->client.x, ewin->client.y,
+                              ewin->client.w, ewin->client.h, 1, &win_attr);
        ewin->win_container =
-          ECreateVisualWindow(frame, 0, 0, 1, 1, 0, &win_attr);
+          ECreateVisualWindow(frame, ewin->client.x, ewin->client.y,
+                              ewin->client.w, ewin->client.h, 0, &win_attr);
 
        if (Conf.argb_client_mode == 1)
           ewin->props.no_border = 1;
-
      }
    else
      {
-       frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
-       ewin->win_container = ECreateWindow(frame, 0, 0, 1, 1, 0);
+       frame =
+          ECreateWindow(VRoot.win, ewin->client.x, ewin->client.y,
+                        ewin->client.w, ewin->client.h, 1);
+       ewin->win_container =
+          ECreateWindow(frame, ewin->client.x, ewin->client.y,
+                        ewin->client.w, ewin->client.h, 0);
      }
 
-   EoInit(ewin, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, 1, NULL);
+   EoInit(ewin, EOBJ_TYPE_EWIN, frame, ewin->client.x, ewin->client.y,
+         ewin->client.w, ewin->client.h, 1, NULL);
    EoSetName(ewin, Estrdup(ewin->icccm.wm_name));
    EobjListFocusAdd(&ewin->o, 1);
    EobjListOrderAdd(&ewin->o);
@@ -260,6 +272,8 @@
    ewin->client.y = y + t;
 
    EoMoveResize(ewin, x, y, ewin->client.w + l + r, ewin->client.h + t + b);
+
+   ewin->client.grav = NorthWestGravity;
 }
 
 static void
@@ -645,6 +659,7 @@
    ewin->state.inhibit_max_ver =
       ewin->props.no_resize_v || ewin->state.fullscreen;
    ewin->state.inhibit_fullscreeen =
+      ewin->state.maximized_horz || ewin->state.maximized_vert ||
       ewin->state.inhibit_move || ewin->state.inhibit_resize;
    ewin->state.inhibit_change_desk = 0;
    ewin->state.inhibit_close = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ewins.h     30 Oct 2005 19:40:49 -0000      1.25
+++ ewins.h     2 Nov 2005 23:03:03 -0000       1.26
@@ -117,6 +117,7 @@
       unsigned            autosave:1;
       unsigned            no_border:1; /* Never apply border */
       unsigned            never_iconify:1;     /* Never iconify */
+      unsigned            no_shadow:1; /* Never apply shadow */
    } props;
    struct
    {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- hints.c     30 Oct 2005 19:40:49 -0000      1.54
+++ hints.c     2 Nov 2005 23:03:03 -0000       1.55
@@ -30,8 +30,8 @@
 #include "hints.h"
 #include "xwin.h"
 
-static Atom         E16_WIN_DATA;
-static Atom         E16_WIN_BORDER;
+static Atom         ENL_WIN_DATA;
+static Atom         ENL_WIN_BORDER;
 
 /*
  * Functions that set X11-properties from E-internals
@@ -62,8 +62,8 @@
 
    Mode.hints.old_root_pmap = HintsGetRootPixmap(VRoot.win);
 
-   E16_WIN_DATA = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
-   E16_WIN_BORDER = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
+   ENL_WIN_DATA = XInternAtom(disp, "ENL_WIN_DATA", False);
+   ENL_WIN_BORDER = XInternAtom(disp, "ENL_WIN_BORDER", False);
 }
 
 void
@@ -300,28 +300,50 @@
    ecore_x_window_prop_card32_set(win, aa, &color, 1);
 }
 
+typedef union
+{
+   struct
+   {
+      unsigned            version:8;
+      unsigned            rsvd:22;
+      unsigned            docked:1;
+      unsigned            iconified:1;
+   } b;
+   int                 all:32;
+} EWinInfoFlags;
+
+#define ENL_DATA_ITEMS      8
+#define ENL_DATA_VERSION    0
+
 void
 EHintsSetInfo(const EWin * ewin)
 {
-   int                 c[9];
+   int                 c[ENL_DATA_ITEMS];
+   EWinInfoFlags       f;
 
    if (EwinIsInternal(ewin))
       return;
 
-   c[0] = EoGetDeskNum(ewin);
-   c[1] = EoIsSticky(ewin);
-   c[2] = EoGetX(ewin);
-   c[3] = EoGetY(ewin);
-   c[4] = ewin->state.iconified;
-   c[5] = ewin->state.shaded;
-   c[6] = ewin->client.w;
-   c[7] = ewin->client.h;
-   c[8] = ewin->state.docked;
+   f.all = 0;
+   f.b.version = ENL_DATA_VERSION;
+   f.b.docked = ewin->state.docked;
+   f.b.iconified = ewin->state.iconified;
+
+   c[0] = f.all;
+
+   c[1] = 0;
+   c[2] = 0;
+
+   c[3] = ewin->lx;
+   c[4] = ewin->ly;
+   c[5] = ewin->lw;
+   c[6] = ewin->lh;
+   c[7] = ewin->ll;
 
-   ecore_x_window_prop_card32_set(_EwinGetClientXwin(ewin), E16_WIN_DATA,
-                                 (unsigned int *)c, 9);
+   ecore_x_window_prop_card32_set(_EwinGetClientXwin(ewin), ENL_WIN_DATA,
+                                 (unsigned int *)c, ENL_DATA_ITEMS);
 
-   ecore_x_window_prop_string_set(_EwinGetClientXwin(ewin), E16_WIN_BORDER,
+   ecore_x_window_prop_string_set(_EwinGetClientXwin(ewin), ENL_WIN_BORDER,
                                  ewin->normal_border->name);
 
    if (EventDebug(EDBUG_TYPE_SNAPS))
@@ -335,40 +357,50 @@
 {
    char               *str;
    int                 num;
-   int                 c[9];
+   int                 c[ENL_DATA_ITEMS + 1];
+   EWinInfoFlags       f;
 
    if (EwinIsInternal(ewin))
       return;
 
-   num =
-      ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), E16_WIN_DATA,
-                                    (unsigned int *)c, 9);
-   if (num < 8)
-      return;
+   num = ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), ENL_WIN_DATA,
+                                       (unsigned int *)c, ENL_DATA_ITEMS + 1);
+   if (num != ENL_DATA_ITEMS)
+     {
+#if 1                          /* FIXME - Remove this after a while */
+       num =
+          ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin),
+                                         XInternAtom(disp, "ENL_INTERNAL_DATA",
+                                                     False),
+                                         (unsigned int *)c, 1);
+       if (num > 0)
+         {
+            ewin->state.identified = 1;
+            ewin->client.grav = StaticGravity;
+            ewin->state.placed = 1;
+         }
+#endif
+       return;
+     }
 
    ewin->state.identified = 1;
+   ewin->client.grav = StaticGravity;
+   ewin->state.placed = 1;
 
-   EoSetDesk(ewin, DeskGet(c[0]));
-   EoSetSticky(ewin, c[1]);
-   ewin->client.x = c[2];
-   ewin->client.y = c[3];
-   ewin->state.iconified = c[4];
-   ewin->state.shaded = c[5];
-   ewin->client.w = c[6];
-   ewin->client.h = c[7];
-   if (num >= 9)               /* Compatibility */
-      ewin->state.docked = c[8];
+   f.all = c[0];
+   if (f.b.version != ENL_DATA_VERSION)
+      return;
+   ewin->icccm.start_iconified = f.b.iconified;
+   ewin->state.docked = f.b.docked;
 
-   ewin->client.grav = NorthWestGravity;
-   if (ewin->state.iconified)
-     {
-       ewin->icccm.start_iconified = 1;
-       ewin->state.iconified = 0;
-     }
-   ewin->state.placed = 1;
+   ewin->lx = c[3];
+   ewin->ly = c[4];
+   ewin->lw = c[5];
+   ewin->lh = c[6];
+   ewin->ll = c[7];
 
    str =
-      ecore_x_window_prop_string_get(_EwinGetClientXwin(ewin), E16_WIN_BORDER);
+      ecore_x_window_prop_string_get(_EwinGetClientXwin(ewin), ENL_WIN_BORDER);
    if (str)
       EwinSetBorderByName(ewin, str);
    Efree(str);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/size.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- size.c      27 Oct 2005 23:18:35 -0000      1.46
+++ size.c      2 Nov 2005 23:03:03 -0000       1.47
@@ -55,6 +55,11 @@
        goto done;
      }
 
+   if (ewin->state.inhibit_max_hor && (direction & MAX_HOR))
+      return;
+   if (ewin->state.inhibit_max_ver && (direction & MAX_VER))
+      return;
+
    type = MAX_ABSOLUTE;                /* Select default */
    if (!resize_type)
       ;




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to