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

Commit 26795a1

Browse files
committed
- revert to previous fix, since this one seems not to work properly on OSX 10.8.x
1 parent 65526e0 commit 26795a1

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

appshell/cefclient_mac.mm

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -691,17 +691,6 @@ - (BOOL)application:(NSApplication *)theApplication openFiles:(NSArray *)filenam
691691
ClientApplication * clientApp = (ClientApplication *)theApplication;
692692
NSWindow* targetWindow = [clientApp findTargetWindow];
693693
if (targetWindow) {
694-
// if files are droppend and the Open/Save Dialog is visible, then browser is NULL
695-
// find the main window. If this is not the main window, then it's a modal dialog like open or save. The main
696-
// window has a reference to the CerBrowser instance
697-
// This fixes https://github.com/adobe/brackets/issues/7752
698-
if (![targetWindow isMainWindow]) {
699-
targetWindow = [targetWindow parentWindow];
700-
}
701-
702-
// move App window to front
703-
[targetWindow orderFront: self];
704-
705694
CefRefPtr<CefBrowser> browser = ClientHandler::GetBrowserForNativeWindow(targetWindow);
706695
NSUInteger count = [filenames count];
707696
if (count) {

appshell/client_handler.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,12 @@ void ClientHandler::SendOpenFileCommand(CefRefPtr<CefBrowser> browser, const Cef
354354
// FIXME: Use SendJSCommand once it supports parameters
355355
std::string cmd = "require('command/CommandManager').execute('file.openDroppedFiles'," + fileArrayStr + ")";
356356

357-
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
357+
// if files are droppend and the Open Dialog is visible, then browser is NULL
358+
// This fixes https://github.com/adobe/brackets/issues/7752
359+
if (browser) {
360+
browser->GetMainFrame()->ExecuteJavaScript(CefString(cmd.c_str()),
358361
browser->GetMainFrame()->GetURL(), 0);
362+
}
359363
}
360364

361365
void ClientHandler::DispatchCloseToNextBrowser()

0 commit comments

Comments
 (0)