-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force single app instance #247
Conversation
Thank you. This should affect all operating systems, from reading the code. (which is good I guess) |
if (app.makeSingleInstance((commandLine, workingDirectory) => { | ||
// Someone tried to run a second instance, we should focus our window. | ||
if (mainWindow) { | ||
mainWindow.show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might change the window state of the already running instance.
- Try to maximize the window, then send it to the task bar (click the _ of the window), then try to start mattermost a second time.
- The other case you need to check is maximize the window, then click the X to send it to the tray, then try to start mattermost a second time.
Something like this should work.
if (mainWindow.isMinimized()) mainWindow.restore();
else mainWindow.show();
@jgis can you please add your change to the changelog.md? I just tested windows 10 and it seems to work flawless, good work. For anyone willing to test, just grab a build from https://circleci.com/gh/mattermost/desktop/575#artifacts |
@@ -30,6 +30,8 @@ Release date: TBD | |||
|
|||
### Bug Fixes | |||
|
|||
#### All platforms | |||
- An existing application instance will be reused instead of starting another instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't have though of this as a bugfix, but as an improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well fine for me, let's wait, what the others say :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my feel, this PR is improvement. The behavior is normal for almost applications whether it’s good or bad. Just existing multiple instances at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change it to an improvement.
This will address this uservoice also https://mattermost.uservoice.com/forums/306457-general/suggestions/15149430-keep-only-one-running-instance-of-the-desktop |
This doesn't affect OS X because originally OS X app works as a single app instance. |
This affects Ubuntu Linux 14.04 (64Bit). Same change in behavior as in Windows. |
@@ -16,10 +16,12 @@ Release date: TBD | |||
|
|||
#### Windows | |||
- Update Mattermost icon for desktop notifications in Windows 10. | |||
|
|||
- An existing application instance will be reused instead of starting another instance. | |||
- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You've slippen in an additional "-" here, which is unneeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @razzeee! I'm learning...
Fantastic!! Big thank you @jgis! Would love to see you join our Desktop community channel if you'd like (and already haven't). We have lots of discussion there around the desktop app across the community and Mattermost team. |
Thanks. |
npm run prettify
to format codesfixes issue #236
This fix may be problematic, if running multiple instances is required.