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

Always use target window for drag-and-drop #19247

Merged
merged 2 commits into from May 1, 2019

Conversation

Projects
None yet
1 participant
@smashwilson
Copy link
Member

commented May 1, 2019

Requirements for Contributing a Bug Fix

Identify the Bug

Fixes #19240.

Description of the Change

Enhance the "open" IPC message understood by AtomApplication to understand a boolean here option. If set to a truthy value, the originating window of the IPC message will be used as a destination for opened paths. Set {here: true} in the "open" message sent from PaneElement in response to a drag-and-drop event. This will cause all files you drag-and-drop to be opened in the window you dragged them onto.

Alternate Designs

I could have added a new IPC message and handler for the "always open in sending window" case, like "open-here". I opted to modify the existing "open" handler instead because it will still do an open action with the dropped paths even if the originating window can't be found for whatever reason - if you drag-and-drop onto a window that's closing or something.

Possible Drawbacks

It introduces additional complexity to the "open" handler.

Verification Process

Open an Atom window in dev mode:

atom -d -f .

Drag and drop any file onto the window. Before this change, the dragged file is opened in a new window; after this change, it's opened in the existing window.

Release Notes

  • Dragging and dropping files onto a dev- or safe-mode window will open the dropped files in that window instead of opening a new one.

smashwilson added some commits May 1, 2019

@smashwilson smashwilson marked this pull request as ready for review May 1, 2019

@smashwilson smashwilson merged commit 3ee3641 into master May 1, 2019

2 checks passed

Atom Pull Requests #20190501.6 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@smashwilson smashwilson deleted the aw/drag-and-drop branch May 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.