Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Open new window on new file without open windows - #7933

Closed
fb55 wants to merge 1 commit into
atom:masterfrom
fb55:patch-1
Closed

fb55 wants to merge 1 commit into
atom:masterfrom
fb55:patch-1

Conversation

@fb55

@fb55 fb55 commented Jul 16, 2015

Copy link
Copy Markdown

Fixes #7171

OSX allows applications to be in focus without an active window, which leads to some unexpected behavior.

@benogle

benogle commented Jul 17, 2015

Copy link
Copy Markdown
Contributor

Seems like we would like to keep the same behavior when there is a focused window, but fix when there is no focused window. Is that what happens here?

cc @maxbrunsfeld

@fb55

fb55 commented Jul 19, 2015

Copy link
Copy Markdown
Author

Seems like we would like to keep the same behavior when there is a focused window, but fix when there is no focused window. Is that what happens here?

The current behavior is kept when there is a focused window and the semantics for opening a new window without a focused window are applied otherwise.

@dolan-a

dolan-a commented Sep 12, 2015

Copy link
Copy Markdown

FYI: this is probably related to #7428, so update accordingly if it addresses.

@fb55

fb55 commented Sep 12, 2015

Copy link
Copy Markdown
Author

That is the same issue.

@maxbrunsfeld maxbrunsfeld self-assigned this Sep 17, 2015

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this would fix anything. If there is no focused window, both evaluate to exactly the same thing, so how does this fix anything if that's exactly the case we want to change the behavior of?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same question. Assuming that the focusedWindow() works properly, this should not change the behavior in the case where there isn't a focused window. Am I missing something @fb55?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Late response: On OSX, it is possible that there is no focused window (eg. when all windows are closed), but the application might still be active and receive keyboard events. Native applications still allow users to open new files via keyboard shortcuts, which isn't supported by Atom.

If there is no focused window, then focusedWindow returns undefined and the command is ignored. Removing this check seemed like a quick fix. Having a second look, the newWindow option of openPath should instead probably be set to Boolean(@focusedWindow()).

Any thoughts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no focused window, then focusedWindow returns undefined and the command is ignored. Removing this check seemed like a quick fix.

I don't think your fix will have the desired effect. With the original code, if @focusedWindow() returned undefined, then this.openPath() would be called. Your change makes it so that this.openPath() is always called, even if there is a focused window.

@joshaber

joshaber commented Jan 4, 2016

Copy link
Copy Markdown
Contributor

#10233 fixed that bug 💥

@joshaber joshaber closed this Jan 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants