|
2026-11-10
| ||
| 17:30 | • Closed ticket [131adc6b]: bound buttonpress is passed on to other program plus 7 other changes artifact: 9a48167e user: nemethi | |
| 17:20 | Fix for [131adc6b77]: bound buttonpress is passed on to other program check-in: f84582b4 user: csaba tags: core-8-6-branch | |
| 17:08 | Fix for [131adc6b77]: bound buttonpress is passed on to other program check-in: 5f5bd4fe user: csaba tags: core-9-0-branch | |
| 16:59 | Fix for [131adc6b77]: bound buttonpress is passed on to other program check-in: d1af9365 user: csaba tags: trunk, main | |
|
2026-10-23
| ||
| 19:17 | • Ticket [131adc6b] bound buttonpress is passed on to other program status still Open with 4 other changes artifact: b77162b1 user: serhiy.storchaka | |
| 19:16 | Fix [131adc6b77]: on Windows and macOS, when the window that got a ButtonPress was destroyed while the button was down, the following ButtonRelease and Motion events went to the window then under the pointer. Discard them until all buttons are released, as X11 does. Document that the release can still reach another application, e.g. when the application exits from a Button binding. closed check-in: 27801b13 user: serhiy.storchaka tags: pointer-dead-restrict-window | |
|
2020-06-04
| ||
| 01:07 | • Ticket [39cbacb9] Aqua: <ButtonRelease-1> sent after closing a toplevel status still Open with 3 other changes artifact: 0bef0d2e user: chrstphrchvz | |
|
2018-07-21
| ||
| 14:03 | • Ticket [131adc6b] bound buttonpress is passed on to other program status still Open with 3 other changes artifact: b7c42a7c user: bll | |
| 13:33 | • Ticket [131adc6b]: 4 changes artifact: 089b427d user: bll | |
|
2016-10-11
| ||
| 15:02 | • Ticket [131adc6b]: 5 changes artifact: d1bf819f user: anonymous | |
|
2016-08-04
| ||
| 18:39 | • Ticket [131adc6b]: 4 changes artifact: ef8aabaa user: anonymous | |
| 18:20 | • Ticket [131adc6b]: 6 changes artifact: 28cf914d user: anonymous | |
|
2016-03-01
| ||
| 16:06 | • New ticket [131adc6b]. artifact: 089ace56 user: anonymous | |
| Ticket UUID: | 131adc6b77dc65d55edc0d108566226079976cb7 | |||
| Title: | bound buttonpress is passed on to other program | |||
| Type: | Bug | Version: | 8.6.18, 9.1.0 | |
| Submitter: | anonymous | Created on: | 2016-03-01 16:06:29 | |
| Subsystem: | 01. Bindings | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Important | |
| Status: | Closed | Last Modified: | 2026-11-10 17:30:45 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2026-11-10 17:30:45 | |||
| Description: |
Start the "trap" program below, then start the test program, position
the test window over the trap window. Then click a mouse button.
This can also be tested by simply positioning the test window over the
windows desktop and using a right-click. Windows will open a context
sensitive menu.
The mouse buttonpress is not consumed and is passed on to the other program below it.
An action performed in one program should never be left unconsumed and
should not be passed on to the program below it.
Reference: https://groups.google.com/d/topic/comp.lang.tcl/bVtTlGgdU-U/discussion
A trap program:
#!/usr/bin/tclsh
package require Tk
proc doexit {} {
update
exit
}
bind . <1> [list . configure -bg yellow]
bind . <2> [list . configure -bg cyan]
bind . <3> [list . configure -bg green]
. configure -width 300
. configure -height 300
And this is the test program:
#!/usr/bin/tclsh
package require Tk
bind . <1> exit
bind . <2> exit
bind . <3> exit
| |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-11-10 17:30:45:
Serhiy, many thanks! Merged into main, core-9-0-branch, and core-8-6-branch by commits [d1af9365], [5f5bd4fe], and [f84582b4]. serhiy.storchaka added on 2026-10-23 19:17:33: Confirmed on Windows 11 (8.6.18, 9.1): when a binding on the ButtonPress destroys the window, the ButtonRelease goes to the window below. Tk had released its mouse grab when the window died, so it sent the remaining button and motion events to the window then under the pointer. X11 is not affected. Fixed on branch pointer-dead-restrict-window ([27801b131f]): these events are discarded until all buttons are released, so other Tk windows of the application no longer get them. Tested on Windows and Linux. This cannot stop the release reaching another application: Windows cancels the mouse capture when the window is destroyed, and if the application exits on the press, nothing is left to catch the release. bind.n now recommends binding such actions to ButtonRelease. bll added on 2018-07-21 14:03:32: Similar to the EatSpuriousMessageBugFix() function, the following could
be added to the windows code immediately before the window is destroyed.
while (PeekMessage(out msg, IntPtr.Zero,
WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE))
;
bll added on 2018-07-21 13:33:40: Still extant on windows. No leak on Linux XFCE. (Updated version) anonymous (claiming to be [email protected]) added on 2016-10-11 15:02:10: Updated title as this is not windows specific. This is a general problem where mouse events in one toplevel window are being leaked to the window below. On Windows, this is particularly bad as the mouse events are leaked through to the OS or other application. Another reference: http://stackoverflow.com/questions/39970281/mouse-events-duplicated-with-tk-menu-commands-not-accelerator-keys anonymous (claiming to be [email protected]) added on 2016-08-04 18:39:58: Linux 8.6.1 also: Clicking on a selection in a top-level window (the bind is: <Double-ButtonPress-1>) and the click is passed through to the (tk) window below. anonymous (claiming to be [email protected]) added on 2016-08-04 18:20:46: This problem is extant with version 8.6.6 on Windows. I have a top-level window where I double click on a selection (the bind is: <Double-ButtonPress-1>) and the click is passed through to the (tk) window below. Updating version and changing priority to important. | |||
