summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2014-10-11 19:56:09 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2014-10-11 19:56:09 (GMT)
commit0751f975f95a43bdc1cb9d057debae488f261717 (patch)
treeedca7f3afa55fe5de794373537d7c96a133bea1b /win
parentcf006cca6531818f85edc021a3a9ba2357d9401c (diff)
parentd1176e92611dc45221e675aaff9afcf04cd77803 (diff)
downloadtk-0751f975f95a43bdc1cb9d057debae488f261717.zip
tk-0751f975f95a43bdc1cb9d057debae488f261717.tar.gz
tk-0751f975f95a43bdc1cb9d057debae488f261717.tar.bz2
Fix [9e487e9f158b3aeda2b92ca75deb3abc04e21a61|9e487e9f15]: Fix for tkWinButton to avoid problems in plugin
FossilOrigin-Name: d093221415b127f26d3e1d970af0bfd9f7371a7f
Diffstat (limited to 'win')
-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: