Reduce logging when the window moves (#1568)
This commit is contained in:
parent
66d78d3ca6
commit
07d19d12c2
1 changed files with 4 additions and 2 deletions
6
main.js
6
main.js
|
@ -2,6 +2,7 @@ const path = require('path');
|
|||
const url = require('url');
|
||||
const os = require('os');
|
||||
|
||||
const _ = require('lodash');
|
||||
const electron = require('electron')
|
||||
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
|
@ -132,8 +133,9 @@ function createWindow () {
|
|||
userConfig.set('window', windowConfig);
|
||||
}
|
||||
|
||||
mainWindow.on('resize', captureAndSaveWindowStats);
|
||||
mainWindow.on('move', captureAndSaveWindowStats);
|
||||
const debouncedCaptureStats = _.debounce(captureAndSaveWindowStats, 500);
|
||||
mainWindow.on('resize', debouncedCaptureStats);
|
||||
mainWindow.on('move', debouncedCaptureStats);
|
||||
mainWindow.on('close', captureAndSaveWindowStats);
|
||||
|
||||
mainWindow.on('focus', function() {
|
||||
|
|
Loading…
Add table
Reference in a new issue