mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
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:
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user