summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-10-18 21:24:57 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-10-18 21:24:57 (GMT)
commit72df3089578116c1b9fdfb15a1c9b1e20a66dc2a (patch)
tree7b455a04c51a00ee7359e46125c3a7244a39810d
parent780118cbac5240ba602ff056b5bd34cb6a57046c (diff)
downloadtk-72df3089578116c1b9fdfb15a1c9b1e20a66dc2a.zip
tk-72df3089578116c1b9fdfb15a1c9b1e20a66dc2a.tar.gz
tk-72df3089578116c1b9fdfb15a1c9b1e20a66dc2a.tar.bz2
Proposed fix for [2160206fff] - Panic (Linux) when posting a menu of type menubar
-rw-r--r--generic/tkMenu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 49b5935..b35be24 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -934,9 +934,14 @@ MenuWidgetObjCmd(
* Tearoff menus are posted differently on Mac and Windows than
* non-tearoffs. TkpPostMenu does not actually map the menu's window
* on those platforms, and popup menus have to be handled specially.
+ * Also, menubar menues are not intended to be posted (bug 1567681,
+ * 2160206).
*/
- if (menuPtr->menuType != TEAROFF_MENU) {
+ if (menuPtr->menuType == MENUBAR) {
+ Tcl_AppendResult(interp, "a menubar menu cannot be posted", NULL);
+ return TCL_ERROR;
+ } else if (menuPtr->menuType != TEAROFF_MENU) {
result = TkpPostMenu(interp, menuPtr, x, y);
} else {
result = TkPostTearoffMenu(interp, menuPtr, x, y);