Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3c0f2c5

Browse files
committed
debug mode, bugfix find active monitor
1 parent a9bd0a3 commit 3c0f2c5

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ function createWindow() {
3636
// and load the index.html of the app.
3737
mainWindow.loadFile('app/index.html');
3838

39-
// Open the DevTools.
40-
mainWindow.webContents.openDevTools();
39+
if (process.env.debug === '1') {
40+
// Open the DevTools.
41+
mainWindow.webContents.openDevTools();
42+
}
4143

4244
let canExit = false;
4345

src/src/modules/monitor.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ export default class Monitor {
109109
* @return {{name: string, status: string, resolution: string, brightness: string, gamma: string}|null}
110110
*/
111111
getDefault() {
112-
return this.getResolutions().find((monitor) => 'primary' === monitor.status) || null;
112+
let monitor = this.getResolutions().find((monitor) => 'primary' === monitor.status) || null;
113+
114+
if (!monitor) {
115+
monitor = _.head(this.getResolutions());
116+
}
117+
118+
return monitor;
113119
}
114120

115121
save() {

0 commit comments

Comments
 (0)