all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Mode line menus
@ 2009-11-07 19:06 Chong Yidong
  2009-11-07 19:30 ` David De La Harpe Golden
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chong Yidong @ 2009-11-07 19:06 UTC (permalink / raw
  To: emacs-devel

Currently, the menus accessible from the mode-line (e.g. by clicking on
the major mode name) are bound to down-mouse-1.  Therefore, you have to
hold down the mouse button after clicking the menus.  Releasing the
mouse button immediately dismisses the menu, selecting the item the
cursor was on (if any).

My understanding is that this behavior is nowadays extremely
non-standard.

Nowadays, clicking on a menu button is expected to pop up a menu, which
is dismissed by clicking elsewhere or by selecting a menu item with
another click.  In Emacs, this can be accomplished simply by binding the
menus to mouse-1 rather than down-mouse-1.  (This works for both GTK and
non-toolkit builds).  The `mouse-appearance-menu' command, bound to
S-mouse-1, already makes use of this behavior.

Is anyone attached to the old behavior?  If not, I'd like to switch to
the standard behavior.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:06 Mode line menus Chong Yidong
@ 2009-11-07 19:30 ` David De La Harpe Golden
  2009-11-07 19:34 ` Andreas Schwab
  2009-11-07 19:42 ` Eli Zaretskii
  2 siblings, 0 replies; 10+ messages in thread
From: David De La Harpe Golden @ 2009-11-07 19:30 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong wrote:
> Currently, the menus accessible from the mode-line (e.g. by clicking on
> the major mode name) are bound to down-mouse-1.  Therefore, you have to
> hold down the mouse button after clicking the menus.  Releasing the
> mouse button immediately dismisses the menu, selecting the item the
> cursor was on (if any).
> 
> My understanding is that this behavior is nowadays extremely
> non-standard.
> 
> Is anyone attached to the old behavior?  If not, I'd like to switch to
> the standard behavior.
> 
> 


Hmm. with "modern" menus, you CAN still select an item by pressing down 
the mouse button (displaying the menu), moving the mouse, and releasing 
on a valid item, selecting the item and immediately dismissing the menu. 
You don't need to click twice.

BUT if you do "click" the button (i.e. press then release before 
selecting an item), the menu stays present, and is dismissed by clicking 
on an item to select it,  or by clicking outside the menu to dismiss 
without selection.








^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:06 Mode line menus Chong Yidong
  2009-11-07 19:30 ` David De La Harpe Golden
@ 2009-11-07 19:34 ` Andreas Schwab
  2009-11-07 19:53   ` Chong Yidong
  2009-11-07 19:42 ` Eli Zaretskii
  2 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2009-11-07 19:34 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Currently, the menus accessible from the mode-line (e.g. by clicking on
> the major mode name) are bound to down-mouse-1.  Therefore, you have to
> hold down the mouse button after clicking the menus.  Releasing the
> mouse button immediately dismisses the menu, selecting the item the
> cursor was on (if any).

I don't see that here.

> Nowadays, clicking on a menu button is expected to pop up a menu, which
> is dismissed by clicking elsewhere or by selecting a menu item with
> another click.

This is exactly the behaviour I get.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:06 Mode line menus Chong Yidong
  2009-11-07 19:30 ` David De La Harpe Golden
  2009-11-07 19:34 ` Andreas Schwab
@ 2009-11-07 19:42 ` Eli Zaretskii
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2009-11-07 19:42 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

> From: Chong Yidong <cyd@stupidchicken.com>
> Date: Sat, 07 Nov 2009 14:06:19 -0500
> 
> Currently, the menus accessible from the mode-line (e.g. by clicking on
> the major mode name) are bound to down-mouse-1.  Therefore, you have to
> hold down the mouse button after clicking the menus.  Releasing the
> mouse button immediately dismisses the menu, selecting the item the
> cursor was on (if any).

This is toolkit-dependent, I think.  At least, on MS-Windows it
doesn't happen (i.e. the menu stays on even after you release
mouse-1).  The same happens on MS-DOS and I think with native
non-toolkit menus (on X without a toolkit) as well.

> I'd like to switch to the standard behavior.

Which is what? that you can release the button without the menu
popping down?  I won't mind that, but please make sure your code works
in a non-toolkit build.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:34 ` Andreas Schwab
@ 2009-11-07 19:53   ` Chong Yidong
  2009-11-07 20:02     ` Chong Yidong
  2009-11-07 20:30     ` David De La Harpe Golden
  0 siblings, 2 replies; 10+ messages in thread
From: Chong Yidong @ 2009-11-07 19:53 UTC (permalink / raw
  To: Andreas Schwab; +Cc: emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

>> Currently, the menus accessible from the mode-line (e.g. by clicking on
>> the major mode name) are bound to down-mouse-1.  Therefore, you have to
>> hold down the mouse button after clicking the menus.  Releasing the
>> mouse button immediately dismisses the menu, selecting the item the
>> cursor was on (if any).
>
> I don't see that here.
>
>> Nowadays, clicking on a menu button is expected to pop up a menu, which
>> is dismissed by clicking elsewhere or by selecting a menu item with
>> another click.
>
> This is exactly the behaviour I get.

Interesting.  Maybe there's a bug.

I'm running a GTK build (i686-pc-linux-gnu, GTK+ Version 2.16.1) on
latest trunk.

If I do a mouse-1 click-and-release on the major mode name, most of the
time it does not pop up a menu.  Instead, I get an echo area message

"mode-line down-mouse-1-"

and that's all.  Once in a while, the menu seems to pop up and stay up.
But this happens very occasionally.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:53   ` Chong Yidong
@ 2009-11-07 20:02     ` Chong Yidong
  2009-11-07 20:30     ` David De La Harpe Golden
  1 sibling, 0 replies; 10+ messages in thread
From: Chong Yidong @ 2009-11-07 20:02 UTC (permalink / raw
  To: Andreas Schwab; +Cc: emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Interesting.  Maybe there's a bug.
>
> I'm running a GTK build (i686-pc-linux-gnu, GTK+ Version 2.16.1) on
> latest trunk.
>
> If I do a mouse-1 click-and-release on the major mode name, most of the
> time it does not pop up a menu.  Instead, I get an echo area message
>
> "mode-line down-mouse-1-"
>
> and that's all.  Once in a while, the menu seems to pop up and stay up.
> But this happens very occasionally.

I just confirmed that mouse-1 pops up the menus fine on a lucid toolkit
build.  So this looks like a bug in the GTK code.

So sorry for the noise; I guess the thing to do is to fix the GTK code.
It appears that the GTK menu is popped down as soon as the mouse-up
event is sent to Emacs.  I'm not sure why this is happening, tho.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 19:53   ` Chong Yidong
  2009-11-07 20:02     ` Chong Yidong
@ 2009-11-07 20:30     ` David De La Harpe Golden
  2009-11-07 23:18       ` David De La Harpe Golden
  1 sibling, 1 reply; 10+ messages in thread
From: David De La Harpe Golden @ 2009-11-07 20:30 UTC (permalink / raw
  To: Chong Yidong; +Cc: Andreas Schwab, emacs-devel

Chong Yidong wrote:

> and that's all.  Once in a while, the menu seems to pop up and stay up.
> But this happens very occasionally.
> 

When I do a mouse-1 -down -up -down and hold, I get a flash of the major 
mode popup modeline menu, then a popup menu containing toolbar and 
menubar menus containing, well, the toolbar and main menubar.

Hnuh?  I don't use the menus anyway, maybe it's a feature.











^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 20:30     ` David De La Harpe Golden
@ 2009-11-07 23:18       ` David De La Harpe Golden
  2009-11-07 23:51         ` Chong Yidong
  0 siblings, 1 reply; 10+ messages in thread
From: David De La Harpe Golden @ 2009-11-07 23:18 UTC (permalink / raw
  To: Chong Yidong; +Cc: Andreas Schwab, emacs-devel

David De La Harpe Golden wrote:
> Chong Yidong wrote:
> 
>> and that's all.  Once in a while, the menu seems to pop up and stay up.
>> But this happens very occasionally.
>> >

Behaviour seems to vary depending on the distance of the modeline
from the bottom of my display.  If the modeline is too close to the 
bottom of my display, the popup does not stay open on click.
GUI toolkits tend to treat menus close to screen edges specially
to ensure they are shown entirely on-screen, so there's certainly room
for window-location-dependent bugs.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 23:18       ` David De La Harpe Golden
@ 2009-11-07 23:51         ` Chong Yidong
  2009-11-08  1:14           ` David De La Harpe Golden
  0 siblings, 1 reply; 10+ messages in thread
From: Chong Yidong @ 2009-11-07 23:51 UTC (permalink / raw
  To: David De La Harpe Golden; +Cc: Andreas Schwab, emacs-devel

David De La Harpe Golden <david@harpegolden.net> writes:

> David De La Harpe Golden wrote:
>> Chong Yidong wrote:
>>
>>> and that's all.  Once in a while, the menu seems to pop up and stay up.
>>> But this happens very occasionally.
>
> Behaviour seems to vary depending on the distance of the modeline
> from the bottom of my display.  If the modeline is too close to the
> bottom of my display, the popup does not stay open on click.
> GUI toolkits tend to treat menus close to screen edges specially
> to ensure they are shown entirely on-screen, so there's certainly room
> for window-location-dependent bugs.

I have checked in a fix for this bug.  The problem, apparently, is that
GTK tries to automagically determine how to pop down the menu based on
the event timestamp, which we were not passing to it.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Mode line menus
  2009-11-07 23:51         ` Chong Yidong
@ 2009-11-08  1:14           ` David De La Harpe Golden
  0 siblings, 0 replies; 10+ messages in thread
From: David De La Harpe Golden @ 2009-11-08  1:14 UTC (permalink / raw
  To: Chong Yidong; +Cc: Andreas Schwab, emacs-devel

Chong Yidong wrote:

> I have checked in a fix for this bug. 

Cool, gone on my sys.

I found it quite easy to popup the menu and then a tooltip that obscures 
it if I paused to read the popup menu before moving to an item - i.e. 
move to the major mode section of the modeline and quickly click to 
popup the menu before the tooltip appears, but then wait a bit while the 
popup is onscreen before moving the mouse after clicking to popup the 
menu, tooltip may still appear - the Fx_hide_tip() you added only covers 
the case where the tip is onscreen before the menu is popped up I think.








^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-11-08  1:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-07 19:06 Mode line menus Chong Yidong
2009-11-07 19:30 ` David De La Harpe Golden
2009-11-07 19:34 ` Andreas Schwab
2009-11-07 19:53   ` Chong Yidong
2009-11-07 20:02     ` Chong Yidong
2009-11-07 20:30     ` David De La Harpe Golden
2009-11-07 23:18       ` David De La Harpe Golden
2009-11-07 23:51         ` Chong Yidong
2009-11-08  1:14           ` David De La Harpe Golden
2009-11-07 19:42 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.