Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752) #450

Merged
merged 4 commits into from
Aug 20, 2014

Conversation

ingorichter
Copy link
Contributor

This bug fixes adobe/brackets#7752.

Before we open any file that was either dropped or send to Brackets via "Open With...", the pointer to the browser instance will be checked to make sure it is not null.

@njx
Copy link
Contributor

njx commented May 30, 2014

Nit for the future: it's best if commit logs include a semantic description of the change in addition to the bug reference.

@peterflynn
Copy link
Member

Also nit -- helpful if the PR title says the name of the bug, or at least a shortened version of it. In places like issue search result lists and GH email notifications, this makes it much easier to see what bug you're referring to (though even when looking directly at this one PR, it's faster than having to hover or click the link to get the issue title).

@ingorichter ingorichter changed the title Fix for https://github.com/adobe/brackets/issues/7752 Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752) May 30, 2014
@ingorichter
Copy link
Contributor Author

Fixed the title and comment.

@bchintx
Copy link
Contributor

bchintx commented Jun 2, 2014

@ingorichter This fixes the crash, but the most recently requested file is then not opened by Brackets. Is it possible to fix it so that Brackets does succeed in opening the file? Or, maybe at least, bring the Brackets window to the front so that the user can see that it's in the middle of a modal Open dialog?

@ingorichter
Copy link
Contributor Author

@bchintx I haven't looked at implementing this behavior and I don't know how much work this will be. What is the behavior with other apps?

@bchintx
Copy link
Contributor

bchintx commented Jun 3, 2014

@ingorichter Other editors work just fine -- ie. the document opens just fine, even while the File Open dialog remains open.

@peterflynn
Copy link
Member

@bchintx @ingorichter Bring to the front (but do nothing else) seems like a reasonable compromise, if it's tricky to have it actually open the file behind the modal dialog.

@peterflynn
Copy link
Member

Thanks for updating the title btw @ingorichter!

@ingorichter
Copy link
Contributor Author

If a modal dialog is open (Open/Save), the parent window will be used to find the required CefBrowser instance. This makes the null check in client_handler.cpp obsolete. The application window will now promoted to the topmost window.

@bchintx
Copy link
Contributor

bchintx commented Aug 18, 2014

@ingorichter I just tested the latest change on my Mac OSX 10.8.5 system. Unfortunately, Brackets still crashes when I try the "Open With..." workflow. Also, the Brackets window doesn't come to the front when I drag-drop a file from the Finder onto the Brackets window either (as I'm assuming it should per your code comment).

At this point, I'm completely fine with your earlier fix of at least fixing the crash -- ie. but that the file is not ever opened nor is the Brackets window brought to front. I guess it's better to not crash, at least.

@ingorichter
Copy link
Contributor Author

@bchintx Yes, I could go back to the previous fix, even if it feels like fixing symptoms. :-(
I have 10.9.4 on my machine which could explain why you still seeing the crash and I'm not. On Raymonds machine there is a crash too, but Raymond also used CEF 1750 for testing and there is something else going on, since the breakpoint in the function that I've fixed gets never hit. :-/
Which CEF version do you use?

@bchintx
Copy link
Contributor

bchintx commented Aug 18, 2014

@ingorichter to test the ingo/fix-7752 branch, it looks like I'm running CEF 1547.

@ingorichter
Copy link
Contributor Author

@bchintx @RaymondLim I have reverted to my previous fix. Would you mind to check this fix again on your machines? Thanks.

@bchintx
Copy link
Contributor

bchintx commented Aug 20, 2014

@ingorichter Latest change works great for me. No crashes on my OSX 10.8.5 system following either the Finder Open With... or Finder drag-n-drop workflows.

@RaymondLim if it works for you too, please go ahead and click the Merge button.

RaymondLim added a commit that referenced this pull request Aug 20, 2014
Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752)
@RaymondLim RaymondLim merged commit 2dd2071 into master Aug 20, 2014
RaymondLim added a commit that referenced this pull request Dec 8, 2015
Fix Crash when open file via OS while File > Open dialog is left open (adobe/brackets#7752)
@marcelgerber marcelgerber deleted the ingo/fix-7752 branch May 23, 2016 08:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants