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

Commit 1e3a4d3

Browse files
committed
Bump electron version and fix Linux window position. Fixes #8
1 parent 6a4e8db commit 1e3a4d3

File tree

4 files changed

+596
-514
lines changed

4 files changed

+596
-514
lines changed

.compilerc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"env",
88
{
99
"targets": {
10-
"electron": "1.8.4"
10+
"electron": "2.0.2"
1111
}
1212
}
1313
],
@@ -26,7 +26,7 @@
2626
"env",
2727
{
2828
"targets": {
29-
"electron": "1.8.4"
29+
"electron": "2.0.2"
3030
}
3131
}
3232
],
@@ -39,4 +39,4 @@
3939
}
4040
}
4141
}
42-
}
42+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"zip"
4141
],
4242
"linux": [
43+
"snap",
4344
"deb",
4445
"rpm"
4546
]
@@ -89,7 +90,7 @@
8990
"dependencies": {
9091
"babel-preset-es2016": "^6.24.1",
9192
"chokidar": "^2.0.0",
92-
"electron": "1.8.4",
93+
"electron": "2.0.2",
9394
"electron-compile": "^6.4.2",
9495
"electron-log": "^2.2.14",
9596
"gitlab-time-tracker": "^1.7.19",
@@ -101,7 +102,7 @@
101102
"babel-plugin-transform-async-to-generator": "^6.24.1",
102103
"babel-preset-env": "^1.6.1",
103104
"babel-preset-react": "^6.24.1",
104-
"electron-forge": "^4.2.0",
105+
"electron-forge": "^5.0.0",
105106
"electron-prebuilt-compile": "1.7.11",
106107
"eslint": "^3",
107108
"eslint-config-airbnb": "^15",

src/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ log.transports.file.appName = 'gtt-taskbar';
1717
let gtt = new events.EventEmitter(),
1818
trayIcon = null,
1919
trayWindow = null,
20+
trayPos = null,
2021
contextMenu = null,
2122
settingsWindow = null,
2223
aboutWindow = null,
@@ -49,7 +50,7 @@ app.on('window-all-closed', () => {
4950
app.disableHardwareAcceleration();
5051

5152
// Single instance
52-
if(app.makeSingleInstance(() => {
53+
if (app.makeSingleInstance(() => {
5354
if (trayWindow) {
5455
trayWindow.show();
5556
trayWindow.focus();
@@ -221,9 +222,12 @@ gtt.setTray = () => {
221222

222223
if (gtt._platform == 'linux') {
223224
let contextMenu = Menu.buildFromTemplate([
224-
{label: 'Open GTT', click: gtt.toggleTrayWindow},
225+
{
226+
label: 'Open GTT', click: gtt.toggleTrayWindow
227+
},
225228
{label: 'Quit', click: app.quit}
226229
]);
230+
227231
trayIcon.setContextMenu(contextMenu);
228232
} else {
229233

@@ -248,8 +252,7 @@ gtt.toggleTrayWindow = bounds => {
248252
y = bounds.y - 250;
249253
}
250254
} else {
251-
let {width} = electron.screen.getPrimaryDisplay().workAreaSize;
252-
x = (width / 2) - (trayWindowBounds.width / 2);
255+
x = electron.screen.getCursorScreenPoint().x - (trayWindowBounds.width / 2);
253256
y = 30;
254257
}
255258

0 commit comments

Comments
 (0)