Skip to content

Commit

Permalink
Fix overwritten window contents when switching panels of VPN Details …
Browse files Browse the repository at this point in the history
…window

Similar to #537 by @m5o but changes only on Mojave and higher.

On macOS Mojave and higher, switching panels in the VPN Details window nowhappens instantly, which avoids the problem introduced in Mojave that caused macOS to ignore the "fade in" time.

On macOS El Capitan and lower, the panel switching behavior does not change: the panels are faded smoothly from one to another.
  • Loading branch information
jkbullard committed Oct 17, 2019
1 parent 235b6f3 commit 341725f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tunnelblick/DBPrefsWindowController.m
Expand Up @@ -15,6 +15,7 @@

#import "DBPrefsWindowController.h"

#import "helper.h"
#import "TBUserDefaults.h"
#import "UIHelper.h"

Expand Down Expand Up @@ -420,10 +421,13 @@ - (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView
}
[self newViewWillAppear: newView identifier: identifier];

if ([self shiftSlowsAnimation] && [[[self window] currentEvent] modifierFlags] & NSShiftKeyMask)
if ( runningOnMojaveOrNewer() ) {
[viewAnimation setDuration: 0.0];
} else if ( [self shiftSlowsAnimation] && [[[self window] currentEvent] modifierFlags] & NSShiftKeyMask ) {
[viewAnimation setDuration:1.25];
else
} else {
[viewAnimation setDuration:0.25];
}

NSDictionary *fadeOutDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
oldView, NSViewAnimationTargetKey,
Expand Down

0 comments on commit 341725f

Please sign in to comment.