Subject: Re: Menus to the left

From: Lars Wirzenius <[email-masked]>
Date: Tue, 25 Jun 1996 20:04:20 +0300

[ Note: I read this mailing list.  There is no need to CC me on replies,
  unless it is _really_ urgent.  I pay for my PPP connections.  Thanks. ]

Since the MIME attachment thingy didn't work, I'll repost (I'll try the
MIME approach some other time; I understand that an attempt at fixing
it was made, thanks).

It still works.  I haven't exited fvwm since I started this patched version.
:-)

--- fvwm-2.0.42/fvwm/menus.c	Fri Apr  5 03:30:47 1996
+++ fvwm-2.0.42.local/fvwm/menus.c	Mon Jun 24 18:03:53 1996
@@ -49,6 +49,8 @@
 int mouse_moved = 0;
 int menu_aborted = 0;
 
+int PrevActiveMenuX = -1;
+
 extern XContext MenuContext;
 /****************************************************************************
  *
@@ -66,6 +68,7 @@
   int x,y;
   Time t0;
   extern Time lastTimestamp;
+  int PrevMenuX = PrevActiveMenuX;

   /* this condition could get ugly */
@@ -127,6 +130,7 @@
     menu_aborted = 1;
   else
     menu_aborted = 0;
+  PrevActiveMenuX = PrevMenuX;
   return retval;
 }
 
@@ -754,6 +758,10 @@
 	  menu->width +1;
     }
 
+  if (PrevActiveMenuX != -1)
+      if (x + menu->width > Scr.MyDisplayWidth - 2) {
+          x = PrevActiveMenuX - menu->width + 2;
+      }
   /* clip to screen */
   if (x + menu->width > Scr.MyDisplayWidth-2) 
     x = Scr.MyDisplayWidth - menu->width-2;
@@ -771,6 +779,8 @@
     }
   if (y < 0) y = 0;
 
+  PrevActiveMenuX = x;
+  
   MenuY = y;
   XMoveWindow(dpy, menu->w, x, y);
   XMapRaised(dpy, menu->w);

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Dan Espen <[email-masked]>
Date: Wed, 26 Jun 1996 10:42:13 -0400

Lars Wirzenius <i-do-not-want-any-unsolicited-commercial-or-uncommercial-email@
iki.fi> writes:
> (Stuff deleted)

I  just compared  the  patch that I   submitted for menus  to the left
versus the patch from Lars Wirzenius.

My approach involved tracking the leftmost menu position to avoid ever
having one menu atop another:

                   Menu1 -> Menu 2 --+
                                     |
            Menu3 <------------------+

Lars took the simpler approach of just putting the menu to the left if
there is no room to the right:

                   Menu1 -> Menu 2 --+
                                     |
                   Menu3 <-----------+

So you can end up  with Menu3 obscuring Menu1.  This  turns out not to
be a problem because  you have to  navigate thru Menu2  to get back to
Menu1 anyway.

Everything considered, I like Lars approach much better than mine.

--
Dan Espen                                    Phone: (908) 699-5570
[email-masked]
444 Hoes Lane  Room RRC 1C-214
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Lars Wirzenius <[email-masked]>
Date: Thu, 27 Jun 1996 00:34:09 +0300

[ NB: I read the list.  Don't CC replies to me.  I pay for my PPP.  Thanks ]

> Everything considered, I like Lars approach much better than mine.

I have no opinion on which is better, but I think I should stress here
that I didn't write that patch!  I just converted it from something
someone else mailed me (which was, I think, meant for Fvwm95).  I'd
say who I got it from, but I deleted the mail.  (Please speak up, whoever
you are, I at least am grateful.)

---

From: Marko Macek <[email-masked]>
Date: Thu, 27 Jun 1996 07:48:14 +0200

> versus the patch from Lars Wirzenius.

The patch applied by Lars to fvwm2 was made by me, originally for fvwm95.

>             Menu3 <------------------+

What do you do with the mouse? Doesn't moving the mouse over menu1 hide
menu3 (unless you are careful where you move it).
 
> Everything considered, I like Lars approach much better than mine.

BTW: Can we make an option not to warp the mouse when the menu is at the bottom
of the screen (this was the part of fvwm95 patch, but Lars removed it).

Mark

---

From: Dan Espen <[email-masked]>
Date: Thu, 27 Jun 1996 08:12:12 -0400

> The patch applied by Lars to fvwm2 was made by me, originally for fvwm95.

Sorry for the mixup.

> menu3 (unless you are careful where you move it).

Well,  thats  one of the reasons  I  like the "Marko" approach better.
You  would move the  mouse off the right of  Menu 2, and circle around
Menu 1 to get to Menu 3.

> BTW: Can we make an option not to warp the mouse when the menu is at
> the bottom of  the screen (this was   the part of fvwm95 patch,  but
> Lars removed it).

If  you don't warp the  pointer to the  top  of the  menu, and you are
using mwm menus near the bottom of the  screen, the menu could come up
with the  pointer on a submenu  line.   Did the original patch  pop up
both menus?