Skip to content

Commit

Permalink
Revert "Improve external display"
Browse files Browse the repository at this point in the history
This reverts commit 0cb303b.
  • Loading branch information
yury committed Sep 24, 2021
1 parent e589907 commit 9a848d1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Blink/SmarterKeys/SmarterTermInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ class CaretHider {
_refreshInputViews()

_inputAccessoryView?.isHidden = false

spaceController?.cleanupControllers()

return res
}
Expand Down
14 changes: 14 additions & 0 deletions Blink/SpaceController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class SpaceController: UIViewController {
_viewportsController.setViewControllers([term], direction: .forward, animated: animated) { (didComplete) in
self._displayHUD()
self._attachInputToCurrentTerm()
self.cleanupControllers()
completion?(didComplete)
}
}
Expand Down Expand Up @@ -647,6 +648,19 @@ extension SpaceController {
@objc func closeShellAction() {
_closeCurrentSpace()
}

func cleanupControllers() {
for c in _termControllers {
if c.view?.superview == nil {
if c.removeFromContainer() {
_termControllers.remove(c)
}
}
if c.view?.window != view.window {
_termControllers.remove(c)
}
}
}

private func _focusOtherWindowAction() {

Expand Down
6 changes: 0 additions & 6 deletions Blink/TermController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ private class ProxyView: UIView {
let parent = superview,
let container = parent.superview
else {
// Delay removal... we need to be firstResponder for a while
DispatchQueue.main.async {
if self.superview == nil {
self.controlledView?.removeFromSuperview()
}
}
_cancelable = nil
return
}
Expand Down
8 changes: 0 additions & 8 deletions KB/Native/Views/KBWebViewBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ + (void)load {
IMP iml = class_getMethodImplementation(cls, NSSelectorFromString(@"_blink_updateTextInputTraits:"));

class_replaceMethod(cls, NSSelectorFromString(@"_updateTextInputTraits:"), iml, nil);

SEL selector = sel_getUid("_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:");
Method method = class_getInstanceMethod(cls, selector);
IMP original = method_getImplementation(method);
IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
});
method_setImplementation(method, override);
}

- (void)_blink_updateTextInputTraits:(id <UITextInputTraits>)traits {
Expand Down

0 comments on commit 9a848d1

Please sign in to comment.