diff --git a/Gruntfile.js b/Gruntfile.js index b0ad7825c..bb63728b1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -29,7 +29,7 @@ module.exports = function (grunt) { resolve = common.resolve, platform = common.platform(), staging; - + if (platform === "mac") { staging = "installer/mac/staging/<%= build.name %>.app/Contents"; } else if (platform === "win") { @@ -63,7 +63,7 @@ module.exports = function (grunt) { /* mac */ "cef-mac": { "dest" : "<%= downloads %>", - "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx.zip" + "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32.zip" }, "cef-mac-symbols": { "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_macosx32_release_symbols.zip", @@ -76,7 +76,7 @@ module.exports = function (grunt) { /* win */ "cef-win": { "dest" : "<%= downloads %>", - "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_windows.zip" + "src" : "<%= cef.url %>/cef_binary_<%= cef.version %>_windows32.zip" }, "cef-win-symbols": { "src" : ["<%= cef.url %>/cef_binary_<%= cef.version %>_windows32_debug_symbols.zip", "<%= cef.url %>/cef_binary_<%= cef.version %>_windows32_release_symbols.zip"], @@ -110,8 +110,10 @@ module.exports = function (grunt) { "Brackets.exe", "node.exe", "cef.pak", + "cef_100_percent.pak", + "cef_200_percent.pak", "devtools_resources.pak", - "icudt.dll", + "icudtl.dat", "libcef.dll" ], "dest" : "installer/win/staging/" @@ -218,7 +220,7 @@ module.exports = function (grunt) { }, "cef": { "url" : "http://s3.amazonaws.com/files.brackets.io/cef", - "version" : "3.1547.1459" + "version" : "3.2171.1902" }, "node": { "version" : "0.10.24" diff --git a/appshell.exe.manifest b/appshell.exe.manifest new file mode 100644 index 000000000..d36f084b6 --- /dev/null +++ b/appshell.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/appshell.gyp b/appshell.gyp index 81e4d4133..44d4ff9ec 100755 --- a/appshell.gyp +++ b/appshell.gyp @@ -1,4 +1,4 @@ - # Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights +# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. @@ -7,11 +7,17 @@ 'pkg-config': 'pkg-config', 'target_arch%': 'environment', 'chromium_code': 1, + 'framework_name': 'Chromium Embedded Framework', + 'linux_use_gold_binary': 0, + 'linux_use_gold_flags': 0, 'conditions': [ [ 'OS=="mac"', { # Don't use clang with CEF binary releases due to Chromium tree structure dependency. 'clang': 0, - }] + }], + [ 'OS=="win"', { + 'multi_threaded_dll%': 0, + }], ] }, 'includes': [ @@ -27,7 +33,11 @@ 'SDKROOT': '', 'CLANG_CXX_LANGUAGE_STANDARD' : 'c++0x', 'COMBINE_HIDPI_IMAGES': 'YES', - 'ARCHS': "$(ARCHS_STANDARD_32_BIT)" + 'ARCHS': "$(ARCHS_STANDARD_32_BIT)", + 'FRAMEWORK_SEARCH_PATHS': [ + '$(inherited)', + '$(CONFIGURATION)' + ] }, }, 'targets': [ @@ -78,11 +88,34 @@ }, }, }, + 'variables': { + 'win_exe_compatibility_manifest': 'compatibility.manifest', + 'xparams': "/efy", + }, + 'actions': [ + { + 'action_name': 'copy_resources', + 'msvs_cygwin_shell': 0, + 'inputs': [], + 'outputs': [ + '<(PRODUCT_DIR)/copy_resources.stamp', + ], + 'action': [ + 'xcopy <(xparams)', + 'Resources\*', + '$(OutDir)', + ], + }, + ], 'msvs_settings': { 'VCLinkerTool': { # Set /SUBSYSTEM:WINDOWS. 'SubSystem': '2', - 'EntryPointSymbol' : 'wWinMainCRTStartup', + }, + 'VCManifestTool': { + 'AdditionalManifestFiles': [ + 'appshell.exe.manifest', + ], }, }, 'link_settings': { @@ -92,9 +125,13 @@ '-lrpcrt4.lib', '-lopengl32.lib', '-lglu32.lib', - '-l$(ConfigurationName)/libcef.lib' + '-l$(ConfigurationName)/libcef.lib', ], }, + 'library_dirs': [ + # Needed to find cef_sandbox.lib using #pragma comment(lib, ...). + '$(ConfigurationName)', + ], 'sources': [ '<@(includes_win)', '<@(appshell_sources_win)', @@ -125,6 +162,26 @@ } ], }], + [ 'OS=="win" and multi_threaded_dll', { + 'configurations': { + 'Debug': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 3, + 'WarnAsError': 'false', + }, + }, + }, + 'Release': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': 2, + 'WarnAsError': 'false', + }, + }, + } + } + }], [ 'OS=="mac"', { 'product_name': '<(appname)', 'dependencies': [ @@ -133,20 +190,6 @@ 'copies': [ { # Add library dependencies to the bundle. - 'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries/', - 'files': [ - '$(CONFIGURATION)/libcef.dylib', - ], - }, - { - # Add other resources to the bundle. - 'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks/Chromium Embedded Framework.framework/', - 'files': [ - 'Resources/', - ], - }, - { - # Add the helper app. 'destination': '<(PRODUCT_DIR)/<(appname).app/Contents/Frameworks', 'files': [ '<(PRODUCT_DIR)/<(appname) Helper.app', @@ -154,13 +197,22 @@ }, ], 'postbuilds': [ + { + 'postbuild_name': 'Add framework', + 'action': [ + 'cp', + '-Rf', + '${CONFIGURATION}/<(framework_name).framework', + '${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Frameworks/' + ], + }, { 'postbuild_name': 'Fix Framework Link', 'action': [ 'install_name_tool', '-change', - '@executable_path/libcef.dylib', - '@executable_path/../Frameworks/Chromium Embedded Framework.framework/Libraries/libcef.dylib', + '@executable_path/<(framework_name)', + '@executable_path/../Frameworks/<(framework_name).framework/<(framework_name)', '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}' ], }, @@ -206,7 +258,7 @@ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/ScriptingBridge.framework', - '$(CONFIGURATION)/libcef.dylib', + '$(CONFIGURATION)/<(framework_name).framework/<(framework_name)', ], }, 'sources': [ @@ -239,7 +291,7 @@ } ], 'cflags': [ - 'ShowDevTools(browser); - - ExtensionString url(browser->GetHost()->GetDevToolsURL(true)); - OpenLiveBrowser(url, false); + CefWindowInfo wi; + CefBrowserSettings settings; + +#if defined(OS_WIN) + wi.SetAsPopup(NULL, "DevTools"); +#endif + browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint()); + } else if (message_name == "GetNodeState") { // Parameters: // 0: int32 - callback id diff --git a/appshell/appshell_extensions_mac.mm b/appshell/appshell_extensions_mac.mm index 53cefc5ee..dea83066f 100644 --- a/appshell/appshell_extensions_mac.mm +++ b/appshell/appshell_extensions_mac.mm @@ -973,8 +973,8 @@ int32 AddMenu(CefRefPtr browser, ExtensionString itemTitle, Extensio relativeId = "window"; } - NSInteger positionIdx = -1; - int32 errCode = getNewMenuPosition(browser, nil, position, relativeId, positionIdx); + int32 positionIdx = -1; + int32 errCode = ::getNewMenuPosition(browser, nil, position, relativeId, positionIdx); // Another position hack. If position is "first" we will change positionIdx to 1 // since we can't allow user to put anything before the Mac OS default application menu. @@ -1101,8 +1101,8 @@ int32 AddMenuItem(CefRefPtr browser, ExtensionString parentCommand, } NativeMenuModel::getInstance(getMenuParent(browser)).setOsItem(tag, (void*)newItem); - NSInteger positionIdx = -1; - int32 errCode = getNewMenuPosition(browser, subMenu, position, relativeId, positionIdx); + int32 positionIdx = -1; + int32 errCode = ::getNewMenuPosition(browser, subMenu, position, relativeId, positionIdx); if (positionIdx > -1) { [subMenu insertItem:newItem atIndex:positionIdx]; } else { diff --git a/appshell/cef_dark_aero_window.cpp b/appshell/cef_dark_aero_window.cpp index 5b318e61d..37cc707f4 100644 --- a/appshell/cef_dark_aero_window.cpp +++ b/appshell/cef_dark_aero_window.cpp @@ -802,7 +802,7 @@ LRESULT cef_dark_aero_window::WindowProc(UINT message, WPARAM wParam, LPARAM lPa break; } - // First let the DesktopWindowManager handler the message and tell us if + // First let the DesktopWindowManager handle the message and tell us if // we should pass the message to the default window proc LRESULT lr = DwpCustomFrameProc(message, wParam, lParam, &callDefWindowProc); diff --git a/appshell/cef_main_window.cpp b/appshell/cef_main_window.cpp index 4f448e8d4..1909b55c8 100644 --- a/appshell/cef_main_window.cpp +++ b/appshell/cef_main_window.cpp @@ -174,7 +174,7 @@ BOOL cef_main_window::HandleCreate() // Creat the new child browser window CefBrowserHost::CreateBrowser(info, static_cast >(g_handler), - ::AppGetInitialURL(), settings); + ::AppGetInitialURL(), settings, NULL); return TRUE; } @@ -220,13 +220,6 @@ BOOL cef_main_window::HandleGetMinMaxInfo(LPMINMAXINFO mmi) return TRUE; } -// WM_DESTROY handler -BOOL cef_main_window::HandleDestroy() -{ - ::PostQuitMessage(0); - return TRUE; -} - // WM_CLOSE handler BOOL cef_main_window::HandleClose() { @@ -238,6 +231,10 @@ BOOL cef_main_window::HandleClose() BOOL closing = (BOOL)::GetProp(hwnd, ::kCefWindowClosingPropName); if (closing) { + if (!g_handler->CanCloseBrowser(GetBrowser())) { + PostMessage(WM_CLOSE, 0 ,0); + return TRUE; + } ::RemoveProp(hwnd, ::kCefWindowClosingPropName); } else @@ -501,8 +498,7 @@ LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) return 0L; break; case WM_DESTROY: - if (HandleDestroy()) - return 0L; + return 0L; // Do not handle the destroy here. break; case WM_CLOSE: if (HandleClose()) diff --git a/appshell/cef_main_window.h b/appshell/cef_main_window.h index 2f441d8fa..a23f798c0 100644 --- a/appshell/cef_main_window.h +++ b/appshell/cef_main_window.h @@ -52,7 +52,6 @@ class cef_main_window : public cef_host_window BOOL HandleEraseBackground(HDC hdc); BOOL HandleCreate(); BOOL HandleSetFocus(HWND hLosingFocus); - BOOL HandleDestroy(); BOOL HandleClose(); BOOL HandleInitMenuPopup(HMENU hMenuPopup); BOOL HandleCommand(UINT commandId); diff --git a/appshell/cefclient.cpp b/appshell/cefclient.cpp index e96faddf5..4058b297b 100644 --- a/appshell/cefclient.cpp +++ b/appshell/cefclient.cpp @@ -80,8 +80,6 @@ void AppGetSettings(CefSettings& settings, CefRefPtr app) { settings.log_severity = LOGSEVERITY_WARNING; else if (str == cefclient::kLogSeverity_Error) settings.log_severity = LOGSEVERITY_ERROR; - else if (str == cefclient::kLogSeverity_ErrorReport) - settings.log_severity = LOGSEVERITY_ERROR_REPORT; else if (str == cefclient::kLogSeverity_Disable) settings.log_severity = LOGSEVERITY_DISABLE; } diff --git a/appshell/cefclient_gtk.cpp b/appshell/cefclient_gtk.cpp index 1cefa4143..ca8630dd9 100644 --- a/appshell/cefclient_gtk.cpp +++ b/appshell/cefclient_gtk.cpp @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) { CefRefPtr app(new ClientApp); // Execute the secondary process, if any. - int exit_code = CefExecuteProcess(main_args, app.get()); + int exit_code = CefExecuteProcess(main_args, app.get(), NULL); if (exit_code >= 0) return exit_code; @@ -165,6 +165,8 @@ int main(int argc, char* argv[]) { // Populate the settings based on command line arguments. AppGetSettings(settings, app); + settings.no_sandbox = TRUE; + // Check cache_path setting if (CefString(&settings.cache_path).length() == 0) { CefString(&settings.cache_path) = AppGetCachePath(); @@ -190,7 +192,7 @@ int main(int argc, char* argv[]) { } // Initialize CEF. - CefInitialize(main_args, settings, app.get()); + CefInitialize(main_args, settings, app.get(), NULL); // Set window icon std::vector icons(APPICONS, APPICONS + sizeof(APPICONS) / sizeof(APPICONS[0]) ); @@ -247,7 +249,7 @@ int main(int argc, char* argv[]) { CefBrowserHost::CreateBrowser( window_info, static_cast >(g_handler), - "file://"+szInitialUrl, browserSettings); + "file://"+szInitialUrl, browserSettings, NULL); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show_all(GTK_WIDGET(window)); diff --git a/appshell/cefclient_mac.mm b/appshell/cefclient_mac.mm index f1d1edbed..e9577d48b 100644 --- a/appshell/cefclient_mac.mm +++ b/appshell/cefclient_mac.mm @@ -655,9 +655,6 @@ - (void)createApp:(id)object { settings.web_security = STATE_DISABLED; CefRefPtr cmdLine = AppGetCommandLine(); - if (cmdLine->HasSwitch(cefclient::kAcceleratedCompositingDisabled)) { - settings.accelerated_compositing = STATE_DISABLED; - } #ifdef DARK_INITIAL_PAGE // Avoid white flash at startup or refresh by making this the default @@ -673,7 +670,7 @@ - (void)createApp:(id)object { NSString* str = [[startupUrl absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; CefBrowserHost::CreateBrowserSync(window_info, g_handler.get(), - [str UTF8String], settings); + [str UTF8String], settings, nil); [self.delegate initUI:mainWnd]; @@ -788,7 +785,7 @@ int main(int argc, char* argv[]) { CefRefPtr app(new ClientApp); // Execute the secondary process, if any. - int exit_code = CefExecuteProcess(main_args, app.get()); + int exit_code = CefExecuteProcess(main_args, app.get(), NULL); if (exit_code >= 0) return exit_code; @@ -805,16 +802,18 @@ int main(int argc, char* argv[]) { CefSettings settings; - // Populate the settings based on command line arguments. + // Populate the settings based on command line arguments. AppGetSettings(settings, app); + settings.no_sandbox = YES; + // Check command if (CefString(&settings.cache_path).length() == 0) { CefString(&settings.cache_path) = AppGetCachePath(); } // Initialize CEF. - CefInitialize(main_args, settings, app.get()); + CefInitialize(main_args, settings, app.get(), NULL); // Load the startup path from prefs CGEventRef event = CGEventCreate(NULL); diff --git a/appshell/cefclient_win.cpp b/appshell/cefclient_win.cpp index 723fd1cc8..89df728e5 100644 --- a/appshell/cefclient_win.cpp +++ b/appshell/cefclient_win.cpp @@ -126,7 +126,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, CefRefPtr app(new ClientApp); // Execute the secondary process, if any. - int exit_code = CefExecuteProcess(main_args, app.get()); + int exit_code = CefExecuteProcess(main_args, app.get(), NULL); if (exit_code >= 0) return exit_code; @@ -180,7 +180,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, } // Initialize CEF. - CefInitialize(main_args, settings, app.get()); + CefInitialize(main_args, settings, app.get(), NULL); CefRefPtr cmdLine = AppGetCommandLine(); if (cmdLine->HasSwitch(cefclient::kStartupPath)) { diff --git a/appshell/client_app.cpp b/appshell/client_app.cpp index d79c4c05f..b67ff4c34 100644 --- a/appshell/client_app.cpp +++ b/appshell/client_app.cpp @@ -238,6 +238,24 @@ void ClientApp::OnContextReleased(CefRefPtr browser, RenderDelegateSet::iterator it = render_delegates_.begin(); for (; it != render_delegates_.end(); ++it) (*it)->OnContextReleased(this, browser, frame, context); + + // This is to fix the crash on quit(https://github.com/adobe/brackets/issues/7683) + // after integrating CEF 2171. + + // On Destruction, callback_map_ was getting destroyed + // in the ClientApp::~ClientApp(). However while removing + // all the elements, it was trying to destroy some stale + // objects which were already deleted. So to fix this, we + // are now explicitly clearing the map here. + + CallbackMap::iterator iCallBack = callback_map_.begin(); + for (; iCallBack != callback_map_.end();) { + if (iCallBack->second.first->IsSame(context)) + callback_map_.erase(iCallBack++); + else + ++iCallBack; + } + } //Simple stack class to ensure calls to Enter and Exit are balanced diff --git a/appshell/client_app_mac.mm b/appshell/client_app_mac.mm index 51f20d290..7894b6703 100644 --- a/appshell/client_app_mac.mm +++ b/appshell/client_app_mac.mm @@ -94,4 +94,4 @@ CefString ClientApp::AppGetDocumentsDirectory() { NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; return CefString([documentsDirectory UTF8String]); -} \ No newline at end of file +} diff --git a/appshell/client_handler.cpp b/appshell/client_handler.cpp index 1fdf6a527..50a0fe231 100644 --- a/appshell/client_handler.cpp +++ b/appshell/client_handler.cpp @@ -162,19 +162,6 @@ void ClientHandler::OnAfterCreated(CefRefPtr browser) { browser_window_map_[browser->GetHost()->GetWindowHandle()] = browser; } -bool ClientHandler::DoClose(CefRefPtr browser) { - REQUIRE_UI_THREAD(); - - if (m_BrowserId == browser->GetIdentifier()) { - // Notify the parent window that it will be closed. - browser->GetHost()->ParentWindowWillClose(); - } - - // A popup browser window is not contained in another window, so we can let - // these windows close by themselves. - return false; -} - void ClientHandler::OnBeforeClose(CefRefPtr browser) { REQUIRE_UI_THREAD(); @@ -182,19 +169,18 @@ void ClientHandler::OnBeforeClose(CefRefPtr browser) { if (m_BrowserId == browser->GetIdentifier()) { // Free the browser pointer so that the browser can be destroyed m_Browser = NULL; - } else if (browser->IsPopup()) { - // Remove the record for DevTools popup windows. - std::set::iterator it = - m_OpenDevToolsURLs.find(browser->GetMainFrame()->GetURL()); - if (it != m_OpenDevToolsURLs.end()) - m_OpenDevToolsURLs.erase(it); } browser_window_map_.erase(browser->GetHost()->GetWindowHandle()); } if (m_quitting) { - DispatchCloseToNextBrowser(); + // Changed the logic to call CefQuitMesaageLoop() + // for windows as it was crashing with 2171 CEF. + if (HasWindows()) + DispatchCloseToNextBrowser(); + else + CefQuitMessageLoop(); } } @@ -334,13 +320,15 @@ bool ClientHandler::OnConsoleMessage(CefRefPtr browser, return false; } -void ClientHandler::OnRequestGeolocationPermission( +bool ClientHandler::OnRequestGeolocationPermission( CefRefPtr browser, const CefString& requesting_url, int request_id, CefRefPtr callback) { // Allow geolocation access from all websites. + // TODO: What does ref app do? callback->Continue(true); + return true; } void ClientHandler::OnBeforeContextMenu( @@ -355,14 +343,6 @@ void ClientHandler::OnBeforeContextMenu( // Add a "Show DevTools" item to all context menus. model->AddItem(CLIENT_ID_SHOW_DEVTOOLS, "&Show DevTools"); - - CefString devtools_url = browser->GetHost()->GetDevToolsURL(true); - if (devtools_url.empty() || - m_OpenDevToolsURLs.find(devtools_url) != m_OpenDevToolsURLs.end()) { - // Disable the menu option if DevTools isn't enabled or if a window is - // already open for the current URL. - model->SetEnabled(CLIENT_ID_SHOW_DEVTOOLS, false); - } } } @@ -418,13 +398,14 @@ std::string ClientHandler::GetLastDownloadFile() { } void ClientHandler::ShowDevTools(CefRefPtr browser) { - std::string devtools_url = browser->GetHost()->GetDevToolsURL(true); - if (!devtools_url.empty() && - m_OpenDevToolsURLs.find(devtools_url) == m_OpenDevToolsURLs.end()) { - m_OpenDevToolsURLs.insert(devtools_url); - browser->GetMainFrame()->ExecuteJavaScript( - "window.open('" + devtools_url + "');", "about:blank", 0); - } + CefWindowInfo wi; + CefBrowserSettings settings; + +#if defined(OS_WIN) + wi.SetAsPopup(NULL, "DevTools"); +#endif + browser->GetHost()->ShowDevTools(wi, browser->GetHost()->GetClient(), settings, CefPoint()); + } bool ClientHandler::SendJSCommand(CefRefPtr browser, const CefString& commandName, CefRefPtr callback) diff --git a/appshell/client_handler.h b/appshell/client_handler.h index 367922cd5..225c02cb8 100644 --- a/appshell/client_handler.h +++ b/appshell/client_handler.h @@ -9,6 +9,7 @@ #include #include #include +#include "include/base/cef_lock.h" #include "include/cef_client.h" #include "util.h" #include "command_callbacks.h" @@ -115,7 +116,6 @@ class ClientHandler : public CefClient, CefBrowserSettings& settings, bool* no_javascript_access) OVERRIDE; virtual void OnAfterCreated(CefRefPtr browser) OVERRIDE; - virtual bool DoClose(CefRefPtr browser) OVERRIDE; virtual void OnBeforeClose(CefRefPtr browser) OVERRIDE; // CefDragHandler methods @@ -157,7 +157,7 @@ class ClientHandler : public CefClient, int line) OVERRIDE; // CefGeolocationHandler methods - virtual void OnRequestGeolocationPermission( + virtual bool OnRequestGeolocationPermission( CefRefPtr browser, const CefString& requesting_url, int request_id, @@ -279,8 +279,6 @@ class ClientHandler : public CefClient, ProcessMessageDelegateSet process_message_delegates_; RequestDelegateSet request_delegates_; - std::set m_OpenDevToolsURLs; - typedef std::map< CefWindowHandle, CefRefPtr > BrowserWindowMap; static BrowserWindowMap browser_window_map_; diff --git a/appshell/client_handler_mac.mm b/appshell/client_handler_mac.mm index e6b3a17ce..af93c3a5f 100644 --- a/appshell/client_handler_mac.mm +++ b/appshell/client_handler_mac.mm @@ -1,6 +1,7 @@ // Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights // reserved. Use of this source code is governed by a BSD-style license that // can be found in the LICENSE file. +#define OS_MAC #import #import @@ -505,6 +506,12 @@ - (void)windowDidResignKey:(NSNotification *)notification { //+ Communicating between the shell and JS is async, so there's no easy way for the JS to decided what to do // in the middle of the key event, unless we introduce promises there, but that is a lot of work now + + // CEF 1750 -- We need to not handle keys for the DevTools Window. + if (browser->GetFocusedFrame()->GetURL() == "chrome-devtools://devtools/devtools.html") { + return false; + } + if([[NSApp mainMenu] performKeyEquivalent: os_event]) { return true; } @@ -533,6 +540,8 @@ - (void)windowDidResignKey:(NSNotification *)notification { return browser; } + + bool ClientHandler::CanCloseBrowser(CefRefPtr browser) { return true; } diff --git a/appshell/client_handler_win.cpp b/appshell/client_handler_win.cpp index f09152b3e..ecc7149ee 100644 --- a/appshell/client_handler_win.cpp +++ b/appshell/client_handler_win.cpp @@ -106,8 +106,8 @@ bool ClientHandler::OnPreKeyEvent(CefRefPtr browser, if (!GetMenu(frameHwnd)) { return false; } - - if (::TranslateAccelerator(frameHwnd, hAccelTable, os_event)) { + + if (os_event && ::TranslateAccelerator(frameHwnd, hAccelTable, os_event)) { return true; } diff --git a/appshell/process_helper_mac.cpp b/appshell/process_helper_mac.cpp index 03fb18ee2..d669a3143 100644 --- a/appshell/process_helper_mac.cpp +++ b/appshell/process_helper_mac.cpp @@ -31,5 +31,5 @@ int main(int argc, char* argv[]) { CefRefPtr app(new ClientApp); // Execute the secondary process. - return CefExecuteProcess(main_args, app); + return CefExecuteProcess(main_args, app, NULL); } diff --git a/appshell_config.gypi b/appshell_config.gypi index b11a966af..f2daa9498 100644 --- a/appshell_config.gypi +++ b/appshell_config.gypi @@ -1,5 +1,5 @@ { 'variables': { - 'appname': "Brackets" + 'appname': "Brackets", } } \ No newline at end of file diff --git a/appshell_paths.gypi b/appshell_paths.gypi index 753b06239..90e60ac42 100755 --- a/appshell_paths.gypi +++ b/appshell_paths.gypi @@ -7,15 +7,45 @@ # Bring in the autogenerated source file lists. 'deps/cef/cef_paths.gypi', ], - 'variables': { + 'variables': { 'includes_common': [ + 'include/base/cef_atomic_ref_count.h', + 'include/base/cef_atomicops.h', + 'include/base/cef_basictypes.h', + 'include/base/cef_bind.h', + 'include/base/cef_bind_helpers.h', + 'include/base/cef_build.h', + 'include/base/cef_callback.h', + 'include/base/cef_callback_forward.h', + 'include/base/cef_callback_helpers.h', + 'include/base/cef_callback_list.h', + 'include/base/cef_cancelable_callback.h', + 'include/base/cef_lock.h', + 'include/base/cef_logging.h', + 'include/base/cef_macros.h', + 'include/base/cef_move.h', + 'include/base/cef_platform_thread.h', + 'include/base/cef_ref_counted.h', + 'include/base/cef_scoped_ptr.h', + 'include/base/cef_string16.h', + 'include/base/cef_template_util.h', + 'include/base/cef_thread_checker.h', + 'include/base/cef_thread_collision_warner.h', + 'include/base/cef_trace_event.h', + 'include/base/cef_tuple.h', + 'include/base/cef_weak_ptr.h', + 'include/base/internal/cef_bind_internal.h', + 'include/base/internal/cef_callback_internal.h', + 'include/base/internal/cef_lock_impl.h', + 'include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h', + 'include/base/internal/cef_thread_checker_impl.h', 'include/cef_base.h', 'include/cef_pack_resources.h', 'include/cef_pack_strings.h', 'include/cef_runnable.h', 'include/cef_version.h', - 'include/internal/cef_build.h', 'include/internal/cef_export.h', + 'include/internal/cef_logging_internal.h', 'include/internal/cef_ptr.h', 'include/internal/cef_string.h', 'include/internal/cef_string_list.h', @@ -23,8 +53,9 @@ 'include/internal/cef_string_multimap.h', 'include/internal/cef_string_types.h', 'include/internal/cef_string_wrappers.h', + 'include/internal/cef_thread_internal.h', 'include/internal/cef_time.h', - 'include/internal/cef_tuple.h', + 'include/internal/cef_trace_event_internal.h', 'include/internal/cef_types.h', 'include/internal/cef_types_wrappers.h', '<@(autogen_cpp_includes)', @@ -35,25 +66,35 @@ ], 'includes_wrapper': [ 'include/wrapper/cef_byte_read_handler.h', + 'include/wrapper/cef_closure_task.h', + 'include/wrapper/cef_helpers.h', + 'include/wrapper/cef_message_router.h', 'include/wrapper/cef_stream_resource_handler.h', 'include/wrapper/cef_xml_object.h', 'include/wrapper/cef_zip_archive.h', + ], 'includes_win': [ + 'include/base/internal/cef_atomicops_x86_msvc.h', + 'include/base/internal/cef_bind_internal_win.h', + 'include/cef_sandbox_win.h', 'include/internal/cef_types_win.h', 'include/internal/cef_win.h', ], 'includes_mac': [ + 'include/base/internal/cef_atomicops_atomicword_compat.h', + 'include/base/internal/cef_atomicops_mac.h', 'include/cef_application_mac.h', 'include/internal/cef_mac.h', 'include/internal/cef_types_mac.h', ], 'includes_linux': [ + 'include/base/internal/cef_atomicops_atomicword_compat.h', + 'include/base/internal/cef_atomicops_x86_gcc.h', 'include/internal/cef_linux.h', 'include/internal/cef_types_linux.h', ], 'libcef_sources_common': [ - 'libcef_dll/cef_logging.h', 'libcef_dll/cpptoc/cpptoc.h', 'libcef_dll/ctocpp/ctocpp.h', 'libcef_dll/libcef_dll.cc', @@ -64,14 +105,28 @@ '<@(autogen_library_side)', ], 'libcef_dll_wrapper_sources_common': [ - 'libcef_dll/cef_logging.h', + 'libcef_dll/base/cef_atomicops_x86_gcc.cc', + 'libcef_dll/base/cef_bind_helpers.cc', + 'libcef_dll/base/cef_callback_helpers.cc', + 'libcef_dll/base/cef_callback_internal.cc', + 'libcef_dll/base/cef_lock.cc', + 'libcef_dll/base/cef_lock_impl.cc', + 'libcef_dll/base/cef_logging.cc', + 'libcef_dll/base/cef_ref_counted.cc', + 'libcef_dll/base/cef_string16.cc', + 'libcef_dll/base/cef_thread_checker_impl.cc', + 'libcef_dll/base/cef_thread_collision_warner.cc', + 'libcef_dll/base/cef_weak_ptr.cc', 'libcef_dll/cpptoc/base_cpptoc.h', 'libcef_dll/cpptoc/cpptoc.h', 'libcef_dll/ctocpp/base_ctocpp.h', 'libcef_dll/ctocpp/ctocpp.h', 'libcef_dll/transfer_util.cpp', 'libcef_dll/transfer_util.h', + 'libcef_dll/wrapper/cef_browser_info_map.h', 'libcef_dll/wrapper/cef_byte_read_handler.cc', + 'libcef_dll/wrapper/cef_closure_task.cc', + 'libcef_dll/wrapper/cef_message_router.cc', 'libcef_dll/wrapper/cef_stream_resource_handler.cc', 'libcef_dll/wrapper/cef_xml_object.cc', 'libcef_dll/wrapper/cef_zip_archive.cc', diff --git a/compatibility.manifest b/compatibility.manifest new file mode 100644 index 000000000..5fc0e50ac --- /dev/null +++ b/compatibility.manifest @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/scripts/fix-msvc.sh b/scripts/fix-msvc.sh new file mode 100644 index 000000000..87fc80253 --- /dev/null +++ b/scripts/fix-msvc.sh @@ -0,0 +1,2 @@ +cat brackets.vcxproj | sed 's.xcopy \\efy.xcopy /efy.g' > brackets.vcxproj.txt +mv brackets.vcxproj.txt brackets.vcxproj diff --git a/scripts/fix-xcode.sh b/scripts/fix-xcode.sh index 6c4c59381..5ff3f806f 100644 --- a/scripts/fix-xcode.sh +++ b/scripts/fix-xcode.sh @@ -13,4 +13,8 @@ mv tmp_pbxproj.txt appshell.xcodeproj/project.pbxproj # XCode is complaining about the "All" target not being optimized for multi-resolution images. # I couldn't find a clean way to fix that in the .gyp file, so it is hard-coded here. sed 's:PRODUCT_NAME = All;:PRODUCT_NAME = All; COMBINE_HIDPI_IMAGES = YES;:' appshell.xcodeproj/project.pbxproj > tmp_pbxproj.txt -mv tmp_pbxproj.txt appshell.xcodeproj/project.pbxproj \ No newline at end of file +mv tmp_pbxproj.txt appshell.xcodeproj/project.pbxproj + +# fix naming issues with CEF +cat appshell.xcodeproj/project.pbxproj | sed 's/$(CONFIGURATION)\/Chromium Embedded Framework.framework/$(CONFIGURATION)/' | sed 's/lastKnownFileType = text; name = \"Chromium Embedded Framework\"/explicitFileType = \"compiled.mach-o.dylib\"; name = \"Chromium Embedded Framework\"/' > tmp_pbxproj.txt +mv tmp_pbxproj.txt appshell.xcodeproj/project.pbxproj diff --git a/tasks/setup.js b/tasks/setup.js index d22b14921..7323061e2 100644 --- a/tasks/setup.js +++ b/tasks/setup.js @@ -459,6 +459,11 @@ module.exports = function (grunt) { // FIXME port to JavaScript? return exec("bash scripts/fix-xcode.sh"); }); + } else if (platform === "win") { + promise = promise.then(function () { + // FIXME port to JavaScript? + return exec("bash scripts/fix-msvc.sh"); + }); } promise.then(function () {