summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorJoe Mistachkin <joe@mistachkin.com>2014-11-11 22:23:34 (GMT)
committerJoe Mistachkin <joe@mistachkin.com>2014-11-11 22:23:34 (GMT)
commitb15c525eedc93a453dfea94482bc1198e27748fc (patch)
tree49a88f59bc168351fe802d8aa68da6d853b823aa /win/tkWinButton.c
parent07f85cd3c1b4934fb746ea36516ba2944b4eea11 (diff)
parentee9722cf78769c35f57383613f570b6e797e74bf (diff)
downloadtk-b15c525eedc93a453dfea94482bc1198e27748fc.zip
tk-b15c525eedc93a453dfea94482bc1198e27748fc.tar.gz
tk-b15c525eedc93a453dfea94482bc1198e27748fc.tar.bz2
Merge updates from core 8.5 branch.
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index f4d2d05..9e1960d 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -1265,21 +1265,29 @@ 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();
+ return 0;
}
- Tcl_ServiceAll();
- return 0;
}
default: