summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2014-10-11 19:59:37 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2014-10-11 19:59:37 (GMT)
commitba0a073448028dc0e91a0b98743dee3b754f5dfe (patch)
treeaaff927695d96514f85843ccf052adeb2c3aac44 /win/tkWinButton.c
parentc162f5437af046cd7e77a75192b228faabd473bd (diff)
parentca92b4d912e2fc4b5692fae4a591f63e289218fe (diff)
downloadtk-ba0a073448028dc0e91a0b98743dee3b754f5dfe.zip
tk-ba0a073448028dc0e91a0b98743dee3b754f5dfe.tar.gz
tk-ba0a073448028dc0e91a0b98743dee3b754f5dfe.tar.bz2
Fix [9e487e9f158b3aeda2b92ca75deb3abc04e21a61|9e487e9f15]: Fix for tkWinButton to avoid problems in plugin
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 ca6d48e..e46bcb3 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_BackgroundException(interp, code);
+ /*
+ * 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_BackgroundException(interp, code);
+ }
+ Tcl_Release((ClientData)interp);
}
- Tcl_Release((ClientData)interp);
+ Tcl_ServiceAll();
+ return 0;
}
- Tcl_ServiceAll();
- return 0;
}
default: