Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewin-ops.c ewins.c 


Log Message:
Fix fullscreen window positioning after restart.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- ewin-ops.c  1 May 2005 11:27:42 -0000       1.27
+++ ewin-ops.c  1 May 2005 13:29:52 -0000       1.28
@@ -464,6 +464,30 @@
    call_depth--;
 }
 
+static void
+GetOnScreenPos(int x, int y, int w, int h, int *px, int *py)
+{
+   int                 dx, dy;
+
+   if (x + w > 4 && x <= VRoot.w - 4 && y + h > 4 && y <= VRoot.h - 4)
+      goto done;
+
+   dx = w / 2;
+   dy = h / 2;
+   x = (x + dx) % VRoot.w;
+   if (x < 0)
+      x += VRoot.w;
+   x -= dx;
+   y = (y + dy) % VRoot.h;
+   if (y < 0)
+      y += VRoot.h;
+   y -= dy;
+
+ done:
+   *px = x;
+   *py = y;
+}
+
 void
 EwinDeIconify(EWin * ewin)
 {
@@ -483,24 +507,9 @@
    x = ox;
    y = oy;
 
+   /* If we iconified an offscreen window, get it back on screen */
    if (!ewin->st.showingdesk)
-     {
-       /* If we iconified an offscreen window, get it back on screen */
-       if (x + EoGetW(ewin) <= 4 || x > VRoot.w - 4 ||
-           y + EoGetH(ewin) <= 4 || y > VRoot.h - 4)
-         {
-            dx = EoGetW(ewin) / 2;
-            dy = EoGetH(ewin) / 2;
-            x = (EoGetX(ewin) + dx) % VRoot.w;
-            if (x < 0)
-               x += VRoot.w;
-            x -= dx;
-            y = (EoGetY(ewin) + dy) % VRoot.h;
-            if (y < 0)
-               y += VRoot.h;
-            y -= dy;
-         }
-     }
+      GetOnScreenPos(x, y, EoGetW(ewin), EoGetH(ewin), &x, &y);
 
    dx = x - ox;
    dy = y - oy;
@@ -1188,7 +1197,20 @@
        ewin->lw = ewin->client.w;
        ewin->lh = ewin->client.h;
        ewin->ll = EoGetLayer(ewin);
-       ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
+       if (on > 1)
+         {
+            /* Fullscreen at startup */
+            on = 1;
+
+            x = EoGetX(ewin);
+            y = EoGetY(ewin);
+            w = ewin->client.w;
+            h = ewin->client.h;
+         }
+       else
+         {
+            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);
@@ -1230,6 +1252,7 @@
        y = ewin->ly;
        w = ewin->lw;
        h = ewin->lh;
+       GetOnScreenPos(x, y, w, h, &x, &y);
        ewin->fixedpos = 0;     /* Yeah - well */
        b = ewin->normal_border;
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- ewins.c     1 May 2005 11:27:42 -0000       1.52
+++ ewins.c     1 May 2005 13:29:53 -0000       1.53
@@ -755,8 +755,7 @@
 
    if (ewin->st.fullscreen)
      {
-       ewin->st.fullscreen = 0;
-       EwinSetFullscreen(ewin, 1);
+       EwinSetFullscreen(ewin, 2);
        ewin->client.already_placed = 1;
        MoveEwinToDesktopAt(ewin, desk, EoGetX(ewin), EoGetY(ewin));
        ShowEwin(ewin);




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to