Fixed bug in handling position of window when selecting 'close' windows item.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8979 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2001-02-06 08:36:13 +00:00
parent 4b03c94712
commit 19ddb5e902
2 changed files with 23 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2001-02-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSMenuView.m: ([-mouseDown:]) modified code for checking
and repositioning of window to cope with situation where the window
changes its size as a result of the mouse down action.
2001-02-04 Fred Kiefer <FredKiefer@gmx.de> 2001-02-04 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSColor.m * Source/NSColor.m

View file

@ -940,13 +940,18 @@
{ {
NSMenu *masterMenu; NSMenu *masterMenu;
NSMenuView *masterMenuView; NSMenuView *masterMenuView;
NSPoint originalLocation; NSRect currentFrame;
NSRect originalFrame;
NSPoint currentTopLeft;
NSPoint originalTopLeft;
menuv_keepAttachedMenus = YES; menuv_keepAttachedMenus = YES;
masterMenu = menuv_menu; masterMenu = menuv_menu;
originalLocation = [[masterMenu window] frame].origin; originalFrame = [[masterMenu window] frame];
originalTopLeft = originalFrame.origin;
originalTopLeft.y += originalFrame.size.height;
masterMenuView = [masterMenu menuRepresentation]; masterMenuView = [masterMenu menuRepresentation];
@ -958,9 +963,17 @@
[NSEvent stopPeriodicEvents]; [NSEvent stopPeriodicEvents];
if (!NSEqualPoints(originalLocation, [[masterMenu window] frame].origin)) currentFrame = [[masterMenu window] frame];
currentTopLeft = currentFrame.origin;
currentTopLeft.y += currentFrame.size.height;
if (NSEqualPoints(currentTopLeft, originalTopLeft) == NO)
{ {
[masterMenu nestedSetFrameOrigin: originalLocation]; NSPoint origin = currentFrame.origin;
origin.x += (originalTopLeft.x - currentTopLeft.x);
origin.y += (originalTopLeft.y - currentTopLeft.y);
[masterMenu nestedSetFrameOrigin: origin];
[masterMenu nestedCheckOffScreen]; [masterMenu nestedCheckOffScreen];
} }
masterMenuView->menuv_keepAttachedMenus = NO; masterMenuView->menuv_keepAttachedMenus = NO;