Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        menus.c 


Log Message:
Fix menu placement on xinerama screens.

===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.289
retrieving revision 1.290
diff -u -3 -r1.289 -r1.290
--- menus.c     29 Sep 2007 19:13:21 -0000      1.289
+++ menus.c     30 Sep 2007 12:56:31 -0000      1.290
@@ -313,23 +313,19 @@
        b = BorderFind(m->style->border_name);
        if (b)
          {
-            int                 width;
-            int                 height;
-            int                 x_origin;
-            int                 y_origin;
-
-            head_num = ScreenGetGeometryByPointer(&x_origin, &y_origin,
-                                                  &width, &height);
-
-            if (wx > x_origin + width - mw - b->border.right)
-               wx = x_origin + width - mw - b->border.right;
-            if (wx < x_origin + b->border.left)
-               wx = x_origin + b->border.left;
-
-            if (wy > y_origin + height - mh - b->border.bottom)
-               wy = y_origin + height - mh - b->border.bottom;
-            if (wy < y_origin + b->border.top)
-               wy = y_origin + b->border.top;
+            int                 sx, sy, sw, sh;
+
+            head_num = ScreenGetGeometryByPointer(&sx, &sy, &sw, &sh);
+
+            if (wx > sx + sw - mw - b->border.right)
+               wx = sx + sw - mw - b->border.right;
+            if (wx < sx + b->border.left)
+               wx = sx + b->border.left;
+
+            if (wy > sy + sh - mh - b->border.bottom)
+               wy = sy + sh - mh - b->border.bottom;
+            if (wy < sy + b->border.top)
+               wy = sy + b->border.top;
          }
      }
 
@@ -1612,16 +1608,25 @@
        EWin               *menus[256], *etmp;
        int                 fx[256], fy[256], tx[256], ty[256];
        int                 i, ww, hh;
+       int                 sx, sy, sw, sh;
        int                 xdist = 0, ydist = 0;
 
        /* Size of new submenu (may be shaded atm.) */
        ww = mi->child->w + bl2 + br2;
        hh = mi->child->h + bt2 + bb2;
 
-       if (EoGetX(ewin) + xo + ww > VRoot.w)
-          xdist = VRoot.w - (EoGetX(ewin) + xo + ww);
-       if (EoGetY(ewin) + yo + hh > VRoot.h)
-          ydist = VRoot.h - (EoGetY(ewin) + yo + hh);
+       ScreenGetGeometryByHead(Mode_menus.first->ewin->head,
+                               &sx, &sy, &sw, &sh);
+
+       if (EoGetX(ewin) + xo + ww > sx + sw)
+          xdist = sx + sw - (EoGetX(ewin) + xo + ww);
+       if (EoGetX(ewin) + xdist < sx)
+          xdist = sx - EoGetX(ewin);
+
+       if (EoGetY(ewin) + yo + hh > sy + sh)
+          ydist = sy + sh - (EoGetY(ewin) + yo + hh);
+       if (EoGetY(ewin) + ydist < sy)
+          ydist = sy - EoGetY(ewin);
 
        if ((xdist != 0) || (ydist != 0))
          {



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to