summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-10-01 18:41:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-10-01 18:41:52 (GMT)
commitd2485d93167c4fe26531ba4d406998356c912675 (patch)
tree2967696cf2bb1a2d49fbf3d731184937c1e9dafc
parent17496cdc52a1eddf082c45994393bc3d2649e0aa (diff)
downloadtk-bug_9e487e9f15.zip
tk-bug_9e487e9f15.tar.gz
tk-bug_9e487e9f15.tar.bz2
Ticket [9e487e9f15]: Fix for tkWinButton to avoid problems in pluginbug_9e487e9f15
-rw-r--r--win/tkWinButton.c32
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;
}