mirror of https://github.com/keeweb/keeweb
merge master
commit
31986b1d50
|
@ -6,18 +6,20 @@ const FocusDetector = {
|
|||
init() {
|
||||
this.isFocused = true;
|
||||
this.detectsFocusWithEvents = !FeatureDetector.isDesktop && !FeatureDetector.isMobile;
|
||||
window.addEventListener('focus', () => {
|
||||
if (!FocusDetector.isFocused) {
|
||||
FocusDetector.isFocused = true;
|
||||
Backbone.trigger('focus');
|
||||
}
|
||||
});
|
||||
window.addEventListener('blur', () => {
|
||||
if (FocusDetector.isFocused) {
|
||||
FocusDetector.isFocused = false;
|
||||
Backbone.trigger('blur');
|
||||
}
|
||||
});
|
||||
if (this.detectsFocusWithEvents) {
|
||||
window.addEventListener('focus', () => {
|
||||
if (!FocusDetector.isFocused) {
|
||||
FocusDetector.isFocused = true;
|
||||
Backbone.trigger('main-window-focus');
|
||||
}
|
||||
});
|
||||
window.addEventListener('blur', () => {
|
||||
if (FocusDetector.isFocused) {
|
||||
FocusDetector.isFocused = false;
|
||||
Backbone.trigger('main-window-blur');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
hasFocus() {
|
||||
|
|
|
@ -69,7 +69,7 @@ const OpenView = Backbone.View.extend({
|
|||
KeyHandler.onKey(Keys.DOM_VK_RETURN, this.enterKeyPress, this);
|
||||
KeyHandler.onKey(Keys.DOM_VK_DOWN, this.moveOpenFileSelectionDown, this);
|
||||
KeyHandler.onKey(Keys.DOM_VK_UP, this.moveOpenFileSelectionUp, this);
|
||||
this.listenTo(Backbone, 'focus', this.windowFocused.bind(this));
|
||||
this.listenTo(Backbone, 'main-window-focus', this.windowFocused.bind(this));
|
||||
},
|
||||
|
||||
render: function () {
|
||||
|
|
|
@ -175,6 +175,7 @@ function createMainWindow() {
|
|||
mainWindow.on('move', delaySaveMainWindowPosition);
|
||||
mainWindow.on('restore', coerceMainWindowPositionToConnectedDisplay);
|
||||
mainWindow.on('close', updateMainWindowPositionIfPending);
|
||||
mainWindow.on('focus', mainWindowFocus);
|
||||
mainWindow.on('blur', mainWindowBlur);
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null;
|
||||
|
@ -282,6 +283,10 @@ function mainWindowBlur() {
|
|||
emitBackboneEvent('main-window-blur');
|
||||
}
|
||||
|
||||
function mainWindowFocus() {
|
||||
emitBackboneEvent('main-window-focus');
|
||||
}
|
||||
|
||||
function emitBackboneEvent(e, arg) {
|
||||
if (mainWindow && mainWindow.webContents) {
|
||||
arg = JSON.stringify(arg);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "KeeWeb",
|
||||
"version": "1.7.6",
|
||||
"version": "1.7.7",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "KeeWeb",
|
||||
"version": "1.7.6",
|
||||
"version": "1.7.7",
|
||||
"description": "Free cross-platform password manager compatible with KeePass",
|
||||
"main": "main.js",
|
||||
"homepage": "https://keeweb.info",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "keeweb",
|
||||
"version": "1.7.6",
|
||||
"version": "1.7.7",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "keeweb",
|
||||
"version": "1.7.6",
|
||||
"version": "1.7.7",
|
||||
"description": "Free cross-platform password manager compatible with KeePass",
|
||||
"main": "Gruntfile.js",
|
||||
"private": true,
|
||||
|
|
|
@ -3,6 +3,9 @@ Release notes
|
|||
##### v1.8.0 (TBD)
|
||||
`*` website icons are be downloaded using favicon.keeweb.info
|
||||
|
||||
##### v1.7.7 (2019-02-09)
|
||||
`-` another attempt to fix focus issues
|
||||
|
||||
##### v1.7.6 (2019-02-07)
|
||||
`-` fixed focus issues in desktop apps
|
||||
|
||||
|
|
Loading…
Reference in New Issue