mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
No partially grey window when leaving full screen
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
NSPoint oldPosition;
|
||||
NSString *oldTabBarStyle;
|
||||
int options;
|
||||
int state;
|
||||
|
||||
// These are only valid in fullscreen mode and store pre-fu vim size
|
||||
int nonFuRows, nonFuColumns;
|
||||
|
||||
@@ -37,6 +37,13 @@
|
||||
#define FUOPT_MAXHORZ 0x002
|
||||
#define FUOPT_BGCOLOR_HLGROUP 0x004
|
||||
|
||||
// Used for 'state' variable
|
||||
enum {
|
||||
BeforeFullScreen = 0,
|
||||
InFullScreen,
|
||||
LeftFullScreen
|
||||
};
|
||||
|
||||
|
||||
@interface MMFullscreenWindow (Private)
|
||||
- (BOOL)isOnPrimaryScreen;
|
||||
@@ -207,6 +214,8 @@
|
||||
kCGDisplayBlendNormal, .0, .0, .0, false);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
}
|
||||
|
||||
state = InFullScreen;
|
||||
}
|
||||
|
||||
- (void)leaveFullscreen
|
||||
@@ -303,6 +312,7 @@
|
||||
|
||||
[self autorelease]; // Balance the above retain
|
||||
|
||||
state = LeftFullScreen;
|
||||
ASLogDebug(@"Left full screen");
|
||||
}
|
||||
|
||||
@@ -402,6 +412,9 @@
|
||||
|
||||
- (void)windowDidMove:(NSNotification *)notification
|
||||
{
|
||||
if (state != InFullScreen)
|
||||
return;
|
||||
|
||||
// Window may move as a result of being dragged between Spaces.
|
||||
ASLogDebug(@"Full screen window moved, ensuring it covers the screen...");
|
||||
|
||||
@@ -413,9 +426,13 @@
|
||||
|
||||
- (void)applicationDidChangeScreenParameters:(NSNotification *)notification
|
||||
{
|
||||
if (state != InFullScreen)
|
||||
return;
|
||||
|
||||
// This notification is sent when screen resolution may have changed (e.g.
|
||||
// due to a monitor being unplugged or the resolution being changed
|
||||
// manually).
|
||||
// manually) but it also seems to get called when the Dock is
|
||||
// hidden/displayed.
|
||||
ASLogDebug(@"Screen unplugged / resolution changed");
|
||||
|
||||
NSScreen *screen = [target screen];
|
||||
|
||||
Reference in New Issue
Block a user