summaryrefslogtreecommitdiffstats
path: root/generic/tkMenuDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-28 14:12:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-08-28 14:12:33 (GMT)
commit7b230572dcf05d7b6af384958d6b2651f4b1f701 (patch)
tree38fd76667434fb184d030c1a34389eb3fc939950 /generic/tkMenuDraw.c
parentef5ce1e5a1b79ba793a9a32118411ea7eda12bbd (diff)
parentd7bc36fb73c5012aca9d234c2330e3da3734aebe (diff)
downloadtk-7b230572dcf05d7b6af384958d6b2651f4b1f701.zip
tk-7b230572dcf05d7b6af384958d6b2651f4b1f701.tar.gz
tk-7b230572dcf05d7b6af384958d6b2651f4b1f701.tar.bz2
[Bug 3562426]: Context menu goes out of edge of screen.
Diffstat (limited to 'generic/tkMenuDraw.c')
-rw-r--r--generic/tkMenuDraw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index 65aa591..c49f513 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -881,12 +881,14 @@ TkPostTearoffMenu(
Tk_GetVRootGeometry(Tk_Parent(menuPtr->tkwin), &vRootX, &vRootY,
&vRootWidth, &vRootHeight);
+ vRootWidth -= Tk_ReqWidth(menuPtr->tkwin);
if (x > vRootX + vRootWidth) {
x = vRootX + vRootWidth;
}
if (x < vRootX) {
x = vRootX;
}
+ vRootHeight -= Tk_ReqHeight(menuPtr->tkwin);
if (y > vRootY + vRootHeight) {
y = vRootY + vRootHeight;
}