[AD] gui-menus patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I detect an error in the gui-menu system:

 - in a small screen size (like 320x200);
 - if a sub-menu overlapped its parents (and the parent not is the menu-bar);
 - when you move the mouse, and select some item which is overlapping an
   item of the parent menu, the item of the parent menu is selected!

Well, this little patch fix it. I test it on ASE 0.0.4 (CVS).
-- 
David A. Capello
dacap@xxxxxxxxxx
http://www.davidcapello.com.ar
--- gui.c.old	Wed Nov  7 09:03:46 2001
+++ gui.c	Thu Nov 15 12:57:31 2001
@@ -1652,11 +1652,13 @@
 
       if (auto_open &&
 	  (gui_menu_opening_delay >= 0)) {            /* menu auto-opening on? */
-         if (mouse_in_parent_menu(m.parent)) {
-            /* automatically goes back to parent */
-            ret = -2;
-            break;
-         }
+	 if (!mouse_in_single_menu(&m)) {
+	    if (mouse_in_parent_menu(m.parent)) {
+	       /* automatically goes back to parent */
+	       ret = -2;
+	       break;
+	    }
+	 }
 
          if ((mouse_sel >= 0) && (m.menu[mouse_sel].child)) {
             if (m.bar) {


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/