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