summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-05-07 20:05:40 (GMT)
committerstanton <stanton@noemail.net>1999-05-07 20:05:40 (GMT)
commite4e427cde58ed02e0216df4afa3b869d38305f67 (patch)
tree399e7c0f1020231a4b92a6992e6004183519860f /library
parentf6744ee34fcb7761d86a9d4d10990539dc45a594 (diff)
downloadtk-e4e427cde58ed02e0216df4afa3b869d38305f67.zip
tk-e4e427cde58ed02e0216df4afa3b869d38305f67.tar.gz
tk-e4e427cde58ed02e0216df4afa3b869d38305f67.tar.bz2
* library/menu.tcl: Fixed bug where tk_popup fails when called too
quickly. [Bug: 2009] FossilOrigin-Name: 61590c0e12759766e9ec51fadc227088fa9f1e2d
Diffstat (limited to 'library')
-rw-r--r--library/menu.tcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index 538e330..177de2b 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -4,7 +4,7 @@
# It also implements keyboard traversal of menus and implements a few
# other utility procedures related to menus.
#
-# RCS: @(#) $Id: menu.tcl,v 1.5 1999/04/16 01:51:26 stanton Exp $
+# RCS: @(#) $Id: menu.tcl,v 1.6 1999/05/07 20:05:40 stanton Exp $
#
# Copyright (c) 1992-1994 The Regents of the University of California.
# Copyright (c) 1994-1997 Sun Microsystems, Inc.
@@ -555,6 +555,10 @@ proc tkMenuMotion {menu x y state} {
proc tkMenuButtonDown menu {
global tkPriv
global tcl_platform
+
+ if {![winfo viewable $menu]} {
+ return
+ }
$menu postcascade active
if {[string compare $tkPriv(postedMb) ""]} {
grab -global $tkPriv(postedMb)
@@ -1242,8 +1246,9 @@ proc tk_popup {menu x y {entry {}}} {
tkMenuUnpost {}
}
tkPostOverPoint $menu $x $y $entry
- if {![string compare $tcl_platform(platform) "unix"]} {
- tkSaveGrabInfo $menu
+ if {![string compare $tcl_platform(platform) "unix"] \
+ && [winfo viewable $menu]} {
+ tkSaveGrabInfo $menu
grab -global $menu
set tkPriv(popup) $menu
tk_menuSetFocus $menu