#68 menu deactivation problem on X11

open
nobody
None
5
2005-05-03
2005-05-03
No

If you pop-up a menu and then click another
(non-freeglut) window, you will see the menu still
active (and possibly hide the part of the focused window).

This behavior is inconsistent with the comment in
freeglut_main.c#766:
| * - Down-click any button outside the menu, menu active:
| * deactivate the menu

Here is a patch.
This only fixes bugs on X11. I don't know whether there
exists this problem on WIN32.

INTERNAL MACROS in this patch:
USE_XGRAB
This patch uses XGrabPointer(). If you don't want to
use XGrabPointer() (typically in debugging), set
USE_XGRAB to 0. If USE_XGRAB is 0, this patch has no
effect at all.
USE_XTESTFAKEBUTTONEVENT
We have two candidates about correct behavior.
"Down-click event (which caused menu deactivation)
should be sent to the underlying window?"
If USE_XTESTFAKEBUTTONEVENT is 0 down-click event
is not
sent to the underlying window.
If USE_XTESTFAKEBUTTONEVENT is 1 down-click event
is resent
to the underlying window.
NO_MULTIPARENTSMENU_HACK
This patch contains several hacks related to
Bugs#1051977. If you already fixed Bugs#1051977,
feel free to set NO_MULTIPARENTSMENU_HACK to 0.

As I'm not familiar with autoconf, please add "-lXtst"
in link options manually when you set
USE_XTESTFAKEBUTTONEVENT to 1.

I followed the comment in freeglut_main.c#814:
| * XXX This isn't enough. A downclick outside of
| * XXX the interior of our freeglut windows should also
| * XXX deactivate the menu. This is more complicated.

Discussion

  • Patch for menu deactivation fix

     
    Attachments