window: Make press-drag-release menu selection mode work
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 30 Oct 2012 17:45:22 +0000 (13:45 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 30 Oct 2012 17:45:31 +0000 (13:45 -0400)
commitd2fbb3870cfaea623a87ba28c9587676bbdc93f7
tree345fe6bbe5d16421de8ee22517ae08a04af99928
parent7330862f9e25d513cfcc49358b7187524a9e1940
window: Make press-drag-release menu selection mode work

The intended behavior is that a quick click (press and then release
within 500ms) just pops up the menu and doesn't select anything.  Then
we can mouse around and and click to select an item.  Alternatively, a
click and hold (ie press and release after 500ms) lets you press right
button, mouse down on the menu item you want and release to select it.
This is how menus work in most toolkits.

The handling in weston is fine, it's there to handle the case where
the button release happens outside any client window, since the client
doesn't get those events.  If such a release happens late or we get a
second release outside the popup window we shut down the popup.

The problem is in toytoolkit, where we need to select the item if we
get a release within 500ms or if we get a second release.  A second
release is the case where the first release came after 500ms and
didn't pop down the menu, and the second release event is from a click
on a menu item.

https://bugs.freedesktop.org/show_bug.cgi?id=52456
clients/window.c