Skip to content
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

Fixes #13905: Set relaunch command for window #15407

Merged
merged 3 commits into from Apr 3, 2017

Conversation

the-ress
Copy link
Contributor

@the-ress the-ress commented Nov 12, 2016

Sets relaunch command to open a new window.

Requires electron/electron#7952.
Fixes #13905.

@mention-bot
Copy link

@the-ress, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bpasero, @egamma and @joaomoreno to be potential reviewers.

@bpasero
Copy link
Member

bpasero commented Nov 12, 2016

@the-ress can you elaborate a bit what SetAppDetailsForWindow does in the end?

@bpasero bpasero self-assigned this Nov 12, 2016
@the-ress
Copy link
Contributor Author

SetAppDetailsForWindow sets these properties for the window (if they're not empty):

Relaunch command and display name must always be set together. Otherwise neither is used.

image-2016_11_12-18_49_17

@bpasero
Copy link
Member

bpasero commented Nov 12, 2016

@the-ress is there an example of an application that leverages this? if I right click on Chrome for example, I am not seeing a relaunch command.

@the-ress
Copy link
Contributor Author

This is what I see when I right click Chrome:

image

Regular Chrome window doesn't override the relaunch command so it just launches chrome.exe without any arguments.

However if I run a chrome app, it opens a in new window that is owned by the same chrome.exe, but it changes its taskbar icon, name and relaunch command (using SetAppDetailsForWindow).

image

The relaunch commands is set to something like chrome.exe --profile-directory=Default --app-id=ibhkjcfebdanponjgchgcgilkoahbpfh. So when I middle-click the button (or shift+click, pin it or click the relaunch menu item), it opens the app and not a regular browser window.

@bpasero
Copy link
Member

bpasero commented Nov 13, 2016

@the-ress that is pretty cool. So what your PR actually fixes is that middle click on the task bar icon opens a new window (something many people have asked for and which I was never sure how to do actually).

@the-ress
Copy link
Contributor Author

Yes. (I referenced the issue in the title of this PR.)

@the-ress
Copy link
Contributor Author

The electron part of this was released in electron 1.4.11.

@bpasero
Copy link
Member

bpasero commented Dec 11, 2016

Thanks for letting me know 👍

@Tyriar
Copy link
Member

Tyriar commented Jan 3, 2017

Please make sure this PR plays nicely with hot exit, see #48 (comment)

This needs to be addressed on Linux as well.

@bpasero
Copy link
Member

bpasero commented Jan 4, 2017

@Tyriar not sure it is fair to ask for this in the same PR, maybe we should have a separate PR for the Linux problem.

@Tyriar
Copy link
Member

Tyriar commented Jan 5, 2017

I added a new CLI arg --new-window-if-not-first which should work for Windows if that's the arg the shortcut uses. #48 (comment)

@bpasero
Copy link
Member

bpasero commented Jan 5, 2017

I think the new argument will not help in this case, see #48 (comment)

@bpasero bpasero merged commit db48235 into microsoft:master Apr 3, 2017
@bpasero bpasero added this to the April 2017 milestone Apr 3, 2017
@bpasero
Copy link
Member

bpasero commented Apr 3, 2017

Optimistically merging this for April since we plan to land Electron 1.6.x.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Middle mouse click on taskbar icon doesn't open a new window
5 participants