merge master

pull/1120/head
antelle 2019-02-09 21:49:23 +01:00
commit 31986b1d50
8 changed files with 27 additions and 17 deletions

View File

@ -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() {

View File

@ -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 () {

View File

@ -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);

View File

@ -1,6 +1,6 @@
{
"name": "KeeWeb",
"version": "1.7.6",
"version": "1.7.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -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",

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "keeweb",
"version": "1.7.6",
"version": "1.7.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -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,

View File

@ -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