Merge pull request #251 from Razzeee/fix-window-state
Improved window state handling
This commit is contained in:
@@ -34,6 +34,8 @@ Release date: TBD
|
|||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
- Fixed an issue where the maximized state of the app window was lost in some cases.
|
||||||
|
|
||||||
|
|
||||||
## Release v1.3.0
|
## Release v1.3.0
|
||||||
|
|
||||||
|
@@ -117,10 +117,16 @@ notification.override({
|
|||||||
if (currentWindow.isVisible()) {
|
if (currentWindow.isVisible()) {
|
||||||
currentWindow.focus();
|
currentWindow.focus();
|
||||||
}
|
}
|
||||||
|
else if (currentWindow.isMinimized()) {
|
||||||
|
currentWindow.restore();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
currentWindow.show();
|
currentWindow.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (currentWindow.isMinimized()) {
|
||||||
|
currentWindow.restore();
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
currentWindow.show();
|
currentWindow.show();
|
||||||
}
|
}
|
||||||
|
12
src/main.js
12
src/main.js
@@ -258,8 +258,13 @@ app.on('ready', function() {
|
|||||||
|
|
||||||
trayIcon.setToolTip(app.getName());
|
trayIcon.setToolTip(app.getName());
|
||||||
trayIcon.on('click', function() {
|
trayIcon.on('click', function() {
|
||||||
if (!mainWindow.isVisible() || mainWindow.isMinimized()) {
|
if (!mainWindow.isVisible()) {
|
||||||
mainWindow.show();
|
if (mainWindow.isMinimized()) {
|
||||||
|
mainWindow.restore();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mainWindow.show();
|
||||||
|
}
|
||||||
mainWindow.focus();
|
mainWindow.focus();
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
app.dock.show();
|
app.dock.show();
|
||||||
@@ -278,7 +283,8 @@ app.on('ready', function() {
|
|||||||
});
|
});
|
||||||
trayIcon.on('balloon-click', function() {
|
trayIcon.on('balloon-click', function() {
|
||||||
if (process.platform === 'win32' || process.platform === 'darwin') {
|
if (process.platform === 'win32' || process.platform === 'darwin') {
|
||||||
mainWindow.show();
|
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||||
|
else mainWindow.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
|
@@ -12,7 +12,12 @@ function createTemplate(mainWindow, config) {
|
|||||||
return {
|
return {
|
||||||
label: team.name,
|
label: team.name,
|
||||||
click: (item, focusedWindow) => {
|
click: (item, focusedWindow) => {
|
||||||
mainWindow.show(); // for OS X
|
if (mainWindow.isMinimized()) {
|
||||||
|
mainWindow.restore();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mainWindow.show();
|
||||||
|
}
|
||||||
mainWindow.webContents.send('switch-tab', i);
|
mainWindow.webContents.send('switch-tab', i);
|
||||||
|
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
|
Reference in New Issue
Block a user