Call recalculateKeyViewLoop after current event loop iteration

This commit is contained in:
Allan Odgaard
2014-07-09 23:09:19 +02:00
parent 36cfb177a5
commit 81e47090cc

View File

@@ -114,6 +114,14 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
[self.window.contentView addConstraints:constraints];
self.layoutConstraints = constraints;
// The auto-calculated key-view loop is sometimes wrong, my theory is that its because of delayed layout
[self performSelector:@selector(delayedRecalculateKeyViewLoop:) withObject:self afterDelay:0];
}
- (void)delayedRecalculateKeyViewLoop:(id)sender
{
[self.window recalculateKeyViewLoop];
}
- (void)showWindow:(id)sender
@@ -161,7 +169,6 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
}
[self setupLayoutConstraints];
[self.window recalculateKeyViewLoop];
[self.window makeFirstResponder:self.keyEquivalentInput ? self.keyEquivalentView : self.searchField];
self.keyEquivalentView.eventString = nil;