#568 tk_popup fails when called too quickly

obsolete: 8.1
closed-fixed
nobody
2
2001-04-04
2000-10-31
No

OriginalBugID: 2009 Bug
Version: 8.1
SubmitDate: '1999-05-07'
LastModified: '1999-05-07'
Severity: SER
Status: Released
Submitter: pat
ChangedBy: stanton
OS: HP-UX
OSVersion: 10.20
Machine: Other
FixedDate: '1999-05-07'
FixedInVersion: 8.1.1

Name:

Frank J. Leitner

Comments:

This error happens in all 8.x version i've tried so far. The second part

of

the patch fixes a bug reported by John Chambers on compl.lang.tcl on

Tue, 04 May 1999 (Message-ID: <372EED34.DD6FC493@gte.com>).

ReproducibleScript:

Simple popup menu:

menu .m

.m add command -label "whatever"

bind . <Button-1> {tk_popup .m %X %Y}

And now multi-click on the toplevel widget at a high frequency. After

some

tries, the following error message appears:

ObservedBehavior:

grab failed: window not viewable

while executing

"grab -global $menu"

(procedure "tkMenuButtonDown" line 33)

invoked from within

"tkMenuButtonDown .m

"

(command bound to event)

DesiredBehavior:

No error message:-)

Patch:

*** menu.tcl.orig Fri May 7 14:05:36 1999

--- menu.tcl Fri May 7 14:20:28 1999

***************

*** 555,560 ****

--- 555,565 ----

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,1248 ****

tkMenuUnpost {}

}

tkPostOverPoint $menu $x $y $entry

! if {![string compare $tcl_platform(platform) "unix"]} {

tkSaveGrabInfo $menu

grab -global $menu

set tkPriv(popup) $menu

--- 1247,1254 ----

tkMenuUnpost {}

}

tkPostOverPoint $menu $x $y $entry

! if {![string compare $tcl_platform(platform) "unix"]

! && [winfo viewable $menu]} {

tkSaveGrabInfo $menu

grab -global $menu

set tkPriv(popup) $menu

PatchFiles:

library/menu.tcl

Discussion

  • Brent B. Welch

    Brent B. Welch - 2000-10-31
    • priority: 5 --> 2
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2001-04-04
    • labels: 104343 --> 10. Generic Menus
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks