mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
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:
parent
ccaf3144d3
commit
339a6fb073
2 changed files with 23 additions and 4 deletions
|
@ -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>
|
||||
|
||||
* Source/NSColor.m
|
||||
|
|
|
@ -940,13 +940,18 @@
|
|||
{
|
||||
NSMenu *masterMenu;
|
||||
NSMenuView *masterMenuView;
|
||||
NSPoint originalLocation;
|
||||
NSRect currentFrame;
|
||||
NSRect originalFrame;
|
||||
NSPoint currentTopLeft;
|
||||
NSPoint originalTopLeft;
|
||||
|
||||
menuv_keepAttachedMenus = YES;
|
||||
|
||||
masterMenu = menuv_menu;
|
||||
|
||||
originalLocation = [[masterMenu window] frame].origin;
|
||||
originalFrame = [[masterMenu window] frame];
|
||||
originalTopLeft = originalFrame.origin;
|
||||
originalTopLeft.y += originalFrame.size.height;
|
||||
|
||||
masterMenuView = [masterMenu menuRepresentation];
|
||||
|
||||
|
@ -958,9 +963,17 @@
|
|||
|
||||
[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];
|
||||
}
|
||||
masterMenuView->menuv_keepAttachedMenus = NO;
|
||||
|
|
Loading…
Reference in a new issue