Skip to content

Commit

Permalink
Set appearance from start and after flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Cabanero committed Sep 8, 2016
1 parent 9877b83 commit c4a2aa1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Blink/TermController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ @implementation TermController {
int _pinput[2];
MCPSession *_session;
BOOL _viewIsLocked;
BOOL _appearanceChanged;
}

+ (void)initialize
Expand Down Expand Up @@ -161,7 +162,9 @@ - (void)listenToControlEvents

- (void) viewDidAppear:(BOOL)animated
{
[self setAppearanceFromSettings];
if (_appearanceChanged) {
[self setAppearanceFromSettings];
}
}

- (void)setAppearanceFromSettings
Expand Down Expand Up @@ -225,6 +228,7 @@ - (void)userContentController:(WKUserContentController *)userContentController
if ([operation isEqualToString:@"sigwinch"]) {
[self updateTermRows:data[@"rows"] Cols:data[@"columns"]];
} else if ([operation isEqualToString:@"terminalready"]) {
[self setAppearanceFromSettings];
[self startSession];
}
}
Expand Down Expand Up @@ -315,7 +319,11 @@ - (void)keyboardFuncTriggerChanged:(NSNotification *)notification
- (void)appearanceChanged:(NSNotification *)notification
{
// NSDictionary *action = [notification userInfo];
[self setAppearanceFromSettings];
if (self.isViewLoaded && self.view.window) {
[self setAppearanceFromSettings];
} else {
_appearanceChanged = YES;
}
}

@end

0 comments on commit c4a2aa1

Please sign in to comment.