From 34d3fa8298631ce5cbfb4be427b0681c3ad1475c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Tue, 28 Aug 2012 13:59:07 +0000 Subject: [Bug 3562426]: Context menu goes out of edge of screen.

PLEASE DON'T PUT THIS ASIDE TO A MISTAKE BRANCH OR SOMETHING! It's simply a fork, in fossil there's nothing wrong with that!

--- ChangeLog | 5 +++++ generic/tkMenuDraw.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 52d9739..89865de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-08-28 Jan Nijtmans + + * generic/tkMenuDraw.c: [Bug 3562426]: Context menu goes out of edge of + screen. + 2012-08-17 Jan Nijtmans * win/nmakehlp.c: Add "-V" option, in order to be able diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c index 7c69548..d4634cd 100644 --- a/generic/tkMenuDraw.c +++ b/generic/tkMenuDraw.c @@ -896,12 +896,14 @@ TkPostTearoffMenu(interp, menuPtr, x, y) 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; } -- cgit v0.12