Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        menus.c 


Log Message:
Fix incorrect menu placement near left screen edge.

===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.255
retrieving revision 1.256
diff -u -3 -r1.255 -r1.256
--- menus.c     8 Aug 2006 03:58:42 -0000       1.255
+++ menus.c     11 Aug 2006 13:45:48 -0000      1.256
@@ -292,8 +292,8 @@
    mw = m->w;
    mh = m->h;
 
-   wx = 0;
-   wy = 0;
+   wx = Mode.events.x - x - (w / 2);
+   wy = Mode.events.y - y - (h / 2);
    if (Conf.menus.onscreen)
      {
        Border             *b;
@@ -309,35 +309,16 @@
             head_num =
                GetPointerScreenGeometry(&x_origin, &y_origin, &width, &height);
 
-            if (Mode.events.x - x - ((int)mw / 2) > x_origin + width)
-               wx = x_origin + b->border.left;
-            else if (Mode.events.x + ((int)mw / 2) > x_origin + width)
+            if (wx > x_origin + width - mw - b->border.right)
                wx = x_origin + width - mw - b->border.right;
-            else
-               wx = Mode.events.x - x - (w / 2);
-
-            if ((wx - ((int)w / 2)) < x_origin)
+            if (wx < x_origin + b->border.left)
                wx = x_origin + b->border.left;
 
-            if (Mode.events.y + (int)mh > VRoot.h)
-               wy = (y_origin + height) - mh - b->border.bottom;
-            else
-               wy = Mode.events.y - y - (h / 2);
-
-            if ((wy - ((int)h / 2) - b->border.top) < y_origin)
+            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;
          }
-       else
-         {
-            /* We should never get here */
-            wx = Mode.events.x - x - (w / 2);
-            wy = Mode.events.y - y - (h / 2);
-         }
-     }
-   else
-     {
-       wx = Mode.events.x - x - (w / 2);
-       wy = Mode.events.y - y - (h / 2);
      }
 
    EMoveWindow(m->win, wx, wy);



-------------------------------------------------------------------------
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