Compare commits

...

3 Commits

Author SHA1 Message Date
Douglas Drumond 34192eeed9 Snapshot 76
Signed-off-by: Douglas Drumond <douglas@cafelinear.com>
2015-04-29 05:59:30 -03:00
Douglas Drumond ca0359465b Merge pull request #6 from jpetrie/multimonitor-window-sizing
Fix 'flicker' during window presentation caused by early-out criteria.
2015-04-29 05:51:47 -03:00
Josh Petrie 8564f74aa2 Fix 'flicker' during window presentation caused by overly-broad early-out criteria. 2015-04-27 19:20:23 -07:00
5 changed files with 35 additions and 5 deletions
+1 -1
View File
@@ -1256,7 +1256,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>75</string>
<string>76</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+9 -1
View File
@@ -769,6 +769,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
if (!screen)
screen = [win screen];
BOOL willSwitchScreens = screen != [win screen];
if (cascadeFrom) {
// Do manual cascading instead of using
// -[MMWindow cascadeTopLeftFromPoint:] since it is rather
@@ -795,7 +796,14 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
ASLogNotice(@"Window not on screen, don't constrain position");
}
[win setFrameTopLeftPoint:topLeft];
// setFrameTopLeftPoint will trigger a resize event if the window is
// moved across monitors; at this point such a resize would incorrectly
// constrain the window to the default vim dimensions, so a specialized
// method is used that will avoid that behavior.
if (willSwitchScreens)
[windowController moveWindowAcrossScreens:topLeft];
else
[win setFrameTopLeftPoint:topLeft];
}
if (1 == [vimControllers count]) {
+2
View File
@@ -45,6 +45,7 @@
NSPoint userTopLeft;
NSPoint defaultTopLeft;
NSToolbar *toolbar;
BOOL resizingDueToMove;
}
- (id)initWithVimController:(MMVimController *)controller;
@@ -55,6 +56,7 @@
- (void)cleanup;
- (void)openWindow;
- (BOOL)presentWindow:(id)unused;
- (void)moveWindowAcrossScreens:(NSPoint)origin;
- (void)updateTabsWithData:(NSData *)data;
- (void)selectTabWithIndex:(int)idx;
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
+21 -1
View File
@@ -150,6 +150,8 @@
self = [super initWithWindow:win];
if (!self) return nil;
resizingDueToMove = NO;
vimController = controller;
decoratedWindow = [win retain];
@@ -347,6 +349,18 @@
return YES;
}
- (void)moveWindowAcrossScreens:(NSPoint)topLeft
{
// HACK! This method moves a window to a new origin and to a different
// screen. This is primarily useful to avoid a scenario where such a move
// will trigger a resize, even though the frame didn't actually change size.
// This method should not be called unless the new origin is definitely on
// a different screen, otherwise the next legitimate resize message will
// be skipped.
resizingDueToMove = YES;
[[self window] setFrameTopLeftPoint:topLeft];
}
- (void)updateTabsWithData:(NSData *)data
{
[vimView updateTabsWithData:data];
@@ -993,7 +1007,13 @@
- (void)windowDidResize:(id)sender
{
if (!setupDone || fullScreenEnabled || !windowPresented) return;
if (resizingDueToMove)
{
resizingDueToMove = NO;
return;
}
if (!setupDone || fullScreenEnabled) return;
// NOTE: Since we have no control over when the window may resize (Cocoa
// may resize automatically) we simply set the view to fill the entire
+2 -2
View File
@@ -614,7 +614,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -645,7 +645,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 76;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",