Try to ensure new windows open with bottom edge visible on screen

In particular, if new windows are set to open maximized in the vertical
direction then the top of newly opened windows will be in line with the
top of the frontmost window.
This commit is contained in:
Bjorn Winckler
2008-08-22 23:07:23 +02:00
parent 6fcd21f338
commit 0b896e4f59
+10
View File
@@ -755,10 +755,20 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
}
if (!NSEqualPoints(topLeft, NSZeroPoint)) {
NSPoint oldTopLeft = topLeft;
if (topWin)
topLeft = [win cascadeTopLeftFromPoint:topLeft];
[win setFrameTopLeftPoint:topLeft];
if ([win frame].origin.y < [[win screen] frame].origin.y) {
// Try to avoid shifting the new window downwards if it means that
// the bottom of the window will be off the screen. E.g. if the
// user has set windows to open maximized in the vertical direction
// then the new window will cascade horizontally only.
topLeft.y = oldTopLeft.y;
[win setFrameTopLeftPoint:topLeft];
}
}
if (1 == [vimControllers count]) {