diff options
author | jan.nijtmans <jan.nijtmans@noemail.net> | 2014-10-01 18:41:52 (GMT) |
---|---|---|
committer | jan.nijtmans <jan.nijtmans@noemail.net> | 2014-10-01 18:41:52 (GMT) |
commit | d1176e92611dc45221e675aaff9afcf04cd77803 (patch) | |
tree | 2967696cf2bb1a2d49fbf3d731184937c1e9dafc /win | |
parent | cf006cca6531818f85edc021a3a9ba2357d9401c (diff) | |
download | tk-d1176e92611dc45221e675aaff9afcf04cd77803.zip tk-d1176e92611dc45221e675aaff9afcf04cd77803.tar.gz tk-d1176e92611dc45221e675aaff9afcf04cd77803.tar.bz2 |
Ticket [9e487e9f15]: Fix for tkWinButton to avoid problems in plugin
FossilOrigin-Name: a0b6440052fee25871346d2c07335be30a711a71
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinButton.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c index f4d2d05..2da8e03 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -1265,20 +1265,28 @@ ButtonProc( return 0; } case BN_CLICKED: { - int code; - Tcl_Interp *interp = butPtr->info.interp; - - if (butPtr->info.state != STATE_DISABLED) { - Tcl_Preserve((ClientData)interp); - code = TkInvokeButton((TkButton*)butPtr); - if (code != TCL_OK && code != TCL_CONTINUE - && code != TCL_BREAK) { - Tcl_AddErrorInfo(interp, "\n (button invoke)"); - Tcl_BackgroundError(interp); + /* + * OOPS: chromium fires WM_NULL regularly to ping if plugin is still + * alive. When using an external window (i.e. via the tcl plugin), this + * causes all buttons to fire once a second, so we need to make sure + * that we are not dealing with the chromium life check. + */ + if (wParam != 0 || lParam != 0) { + int code; + Tcl_Interp *interp = butPtr->info.interp; + + if (butPtr->info.state != STATE_DISABLED) { + Tcl_Preserve((ClientData)interp); + code = TkInvokeButton((TkButton*)butPtr); + if (code != TCL_OK && code != TCL_CONTINUE + && code != TCL_BREAK) { + Tcl_AddErrorInfo(interp, "\n (button invoke)"); + Tcl_BackgroundError(interp); + } + Tcl_Release((ClientData)interp); } - Tcl_Release((ClientData)interp); + Tcl_ServiceAll(); } - Tcl_ServiceAll(); return 0; } |