fix window focus

This commit is contained in:
antelle 2016-08-19 00:26:35 +03:00
parent 2f0b16d40c
commit 15c5494658
1 changed files with 6 additions and 1 deletions

View File

@ -167,19 +167,24 @@ var AutoType = {
this.pendingEvent = evt;
this.appModel.files.once('update', this.processPendingEvent, this);
logger.debug('auto-type event delayed');
setTimeout(() => Launcher.showMainWindow(), Timeouts.RedrawInactiveWindow);
this.focusMainWindow();
} else {
this.processEventWithFilter(evt);
}
});
},
focusMainWindow() {
setTimeout(() => Launcher.showMainWindow(), Timeouts.RedrawInactiveWindow);
},
processEventWithFilter(evt) {
let entries = evt.filter.getEntries();
if (entries.length === 1) {
this.runAndHandleResult(entries.at(0));
return;
}
this.focusMainWindow();
this.selectEntryView = new AutoTypeSelectView({
model: { filter: evt.filter }
}).render();