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

Implement OS X Cmd+W to close windows, clicking dock icon to open windows #29

Closed
wants to merge 1 commit into from

Conversation

ggamel
Copy link
Contributor

@ggamel ggamel commented Oct 15, 2015

This updates Photon to implement native OS X Window handling (e.g. Cmd+W closes windows, clicking dock icon opens windows, and Cmd+Q quits the app).

This implements what I proposed in #12.

This updates Photon to implement native OS X Window handling (e.g. Cmd+W closes windows, clicking dock icon opens windows, and Cmd+Q quits the app).
@ggamel ggamel changed the title Update app.js to implement OS X window handling Implement OS X Cmd+W to close windows, clicking dock icon to open windows Nov 4, 2015
@thiakil
Copy link

thiakil commented Mar 31, 2016

As it is, your code will only work on OS X; on other platforms it will always be hidden in the background, as you simply hide the window on close and the all windows closed event will never fire.

Is it also not true that in most applications when you use cmd-w or the red button that the window IS actually destroyed and when clicking the dock icon a fresh one is created (e.g. with no opened documents)?

It looks as though what you're doing with a simple window could easily be done by putting the new BrowserWindow & loadUrl in a function and call that from both the ready handler & activate handler instead of hiding it.

In your issue comment you mention audio playing in the background; hiding the window is an alternative to playing in a hidden background window, but I don't think it should be the default behaviour.

I would suggest making it a separate example file.

@ggamel ggamel closed this Sep 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants