Skip to content

Commit

Permalink
Fix input with multiple screens
Browse files Browse the repository at this point in the history
  • Loading branch information
yury committed Dec 1, 2018
1 parent ebc1b01 commit cab26e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Blink/LayoutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ + (UIEdgeInsets) buildSafeInsetsForController:(UIViewController *)ctrl andMode:(
UIWindow *window = ctrl.view.window;
BOOL isMainScreen = window.screen == mainScreen;

// we are external monitor, so we use device margins to accomodate overscan and ignore mode
// we are on external monitor, so we use device margins to accomodate overscan and ignore mode
// it is like BKLayoutModeSafeFit mode
if (!isMainScreen) {
return deviceMargins;
Expand Down
6 changes: 5 additions & 1 deletion Blink/TermInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,11 @@ - (BOOL)becomeFirstResponder
self.inputAssistantItem.leadingBarButtonGroups = @[];

// reload input views to get rid of kb input views from other apps.
[self reloadInputViews];
// also we should reload input views on next event loop. Otherwise inputs messed up
// with multiple screens
dispatch_async(dispatch_get_main_queue(), ^{
[self reloadInputViews];
});
[_device focus];
} else {
[_device blur];
Expand Down

0 comments on commit cab26e5

Please sign in to comment.