mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Move window to top of screen if bottom is obscured
This commit is contained in:
@@ -642,7 +642,8 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
|
||||
if ([win frame].origin.y < [[win screen] frame].origin.y) {
|
||||
NSPoint screenOrigin = [[win screen] frame].origin;
|
||||
if ([win frame].origin.y < screenOrigin.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
|
||||
@@ -650,6 +651,13 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
topLeft.y = oldTopLeft.y;
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
}
|
||||
|
||||
if ([win frame].origin.y < screenOrigin.y) {
|
||||
// Move the window to the top of the screen if the bottom of the
|
||||
// window is still obscured.
|
||||
topLeft.y = NSMaxY([[win screen] frame]);
|
||||
[win setFrameTopLeftPoint:topLeft];
|
||||
}
|
||||
}
|
||||
|
||||
if (1 == [vimControllers count]) {
|
||||
|
||||
Reference in New Issue
Block a user