Skip to content

Commit

Permalink
Merge branch 'electron:main' into fix-app-relaunch
Browse files Browse the repository at this point in the history
  • Loading branch information
p120ph37 committed Jul 27, 2022
2 parents 83decad + de1cec8 commit 85aa2fc
Show file tree
Hide file tree
Showing 39 changed files with 838 additions and 844 deletions.
2 changes: 1 addition & 1 deletion DEPS
Expand Up @@ -4,7 +4,7 @@ vars = {
'chromium_version':
'105.0.5187.0',
'node_version':
'v16.15.1',
'v16.16.0',
'nan_version':
'16fa32231e2ccd89d2804b3f765319128b20c4ac',
'squirrel.mac_version':
Expand Down
2 changes: 1 addition & 1 deletion ELECTRON_VERSION
@@ -1 +1 @@
21.0.0-nightly.20220725
21.0.0-nightly.20220727
9 changes: 3 additions & 6 deletions appveyor.yml
Expand Up @@ -170,19 +170,16 @@ build_script:
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
# Temporarily disable symbol generation on 32-bit Windows due to failures
- ps: >-
if ($env:GN_CONFIG -eq 'release' -And $env:TARGET_ARCH -ne 'ia32') {
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
if ($env:TARGET_ARCH -ne 'ia32') {
python electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
}
python electron\script\zip-symbols.py
appveyor-retry appveyor PushArtifact out/Default/symbols.zip
} else {
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
Expand Down
6 changes: 5 additions & 1 deletion build/extract_symbols.gni
Expand Up @@ -24,7 +24,11 @@ template("extract_symbols") {
assert(defined(invoker.binary), "Need binary to dump")
assert(defined(invoker.symbol_dir), "Need directory for symbol output")

dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
if (host_os == "win" && target_cpu == "x86") {
dump_syms_label = "//third_party/breakpad:dump_syms(//build/toolchain/win:win_clang_x64)"
} else {
dump_syms_label = "//third_party/breakpad:dump_syms($host_toolchain)"
}
dump_syms_binary = get_label_info(dump_syms_label, "root_out_dir") +
"/dump_syms$_host_executable_suffix"

Expand Down
5 changes: 5 additions & 0 deletions docs/api/app.md
Expand Up @@ -130,6 +130,11 @@ set `NSPrincipalClass` to `AtomApplication`.

You should call `event.preventDefault()` if you want to handle this event.

As with the `open-file` event, be sure to register a listener for the `open-url`
event early in your application startup to detect if the the application being
is being opened to handle a URL. If you register the listener in response to a
`ready` event, you'll miss URLs that trigger the launch of your application.

### Event: 'activate' _macOS_

Returns:
Expand Down
22 changes: 11 additions & 11 deletions docs/api/native-image.md
Expand Up @@ -149,7 +149,7 @@ console.log(image)
* `options` Object
* `width` Integer
* `height` Integer
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `NativeImage`

Expand All @@ -162,7 +162,7 @@ pixel data returned by `toBitmap()`. The specific format is platform-dependent.
* `options` Object (optional)
* `width` Integer (optional) - Required for bitmap buffers.
* `height` Integer (optional) - Required for bitmap buffers.
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `NativeImage`

Expand Down Expand Up @@ -225,7 +225,7 @@ The following methods are available on instances of the `NativeImage` class:
#### `image.toPNG([options])`

* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `Buffer` - A [Buffer][buffer] that contains the image's `PNG` encoded data.

Expand All @@ -238,22 +238,22 @@ Returns `Buffer` - A [Buffer][buffer] that contains the image's `JPEG` encoded d
#### `image.toBitmap([options])`

* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `Buffer` - A [Buffer][buffer] that contains a copy of the image's raw bitmap pixel
data.

#### `image.toDataURL([options])`

* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `string` - The data URL of the image.

#### `image.getBitmap([options])`

* `options` Object (optional)
* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `Buffer` - A [Buffer][buffer] that contains the image's raw bitmap pixel data.

Expand All @@ -276,7 +276,7 @@ Returns `boolean` - Whether the image is empty.

#### `image.getSize([scaleFactor])`

* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns [`Size`](structures/size.md).

Expand Down Expand Up @@ -317,20 +317,20 @@ will be preserved in the resized image.

#### `image.getAspectRatio([scaleFactor])`

* `scaleFactor` Double (optional) - Defaults to 1.0.
* `scaleFactor` Number (optional) - Defaults to 1.0.

Returns `Float` - The image's aspect ratio.
Returns `Number` - The image's aspect ratio.

If `scaleFactor` is passed, this will return the aspect ratio corresponding to the image representation most closely matching the passed value.

#### `image.getScaleFactors()`

Returns `Float[]` - An array of all scale factors corresponding to representations for a given nativeImage.
Returns `Number[]` - An array of all scale factors corresponding to representations for a given nativeImage.

#### `image.addRepresentation(options)`

* `options` Object
* `scaleFactor` Double - The scale factor to add the image representation for.
* `scaleFactor` Number (optional) - The scale factor to add the image representation for.
* `width` Integer (optional) - Defaults to 0. Required if a bitmap buffer
is specified as `buffer`.
* `height` Integer (optional) - Defaults to 0. Required if a bitmap buffer
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "electron",
"version": "21.0.0-nightly.20220725",
"version": "21.0.0-nightly.20220727",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions patches/chromium/.patches
Expand Up @@ -113,3 +113,4 @@ feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
fix_allow_guest_webcontents_to_enter_fullscreen.patch
disable_freezing_flags_after_init_in_node.patch
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
chore_add_electron_deps_to_gitignores.patch
47 changes: 47 additions & 0 deletions patches/chromium/chore_add_electron_deps_to_gitignores.patch
@@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@salesforce.com>
Date: Tue, 26 Jul 2022 00:05:29 -0700
Subject: chore: add electron deps to gitignores

Makes things like "git status" quicker when developing electron locally

diff --git a/.gitignore b/.gitignore
index d68a1b2dd91704a00be9cce6ccfa5daf7da35e1a..ab30dd802543491352d3b407f12127c04742d1ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -229,6 +229,7 @@ vs-chromium-project.txt
/delegate_execute
/device/serial/device_serial_mojo.xml
/docs/website
+/electron
/google_apis/gcm/gcm.xml
/google_apis/internal
/googleurl
diff --git a/third_party/.gitignore b/third_party/.gitignore
index 63611fc675a17af16dc20cbd9b20e28db63a7ead..eb369ac8b3bc0c2344491438b67e1618d2efb244 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -83,6 +83,7 @@
/directxsdk
/dom_distiller_js/dist
/eigen3/src
+/electron_node
/elfutils/src
/emoji-segmenter/src
/emoji-metadata/src
@@ -179,6 +180,7 @@
/mocha
/mockito/src
/nacl_sdk_binaries/
+/nan
/nasm
/nearby/src
/neon_2_sse/src
@@ -242,6 +244,7 @@
/speex
/sqlite/src
/sqlite4java/lib/
+/squirrel.mac
/subresource-filter-ruleset/data/UnindexedRules
/swift-format
/swiftshader/
20 changes: 16 additions & 4 deletions patches/chromium/disable_color_correct_rendering.patch
Expand Up @@ -20,14 +20,15 @@ to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.

diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 6a148c3173f8f5653b945ed9b6ffcbf48d76d511..b30c2e686ff9b64691142ff893225c60cedeaebd 100644
index 6a148c3173f8f5653b945ed9b6ffcbf48d76d511..3809ffe0f487e60539db58980b3232030ce8d4f8 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1864,6 +1864,9 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -1864,6 +1864,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
+ if (!settings_.enable_color_correct_rendering) {
+ params.color_space = gfx::ColorSpace();
+ return params;
+ }

Expand Down Expand Up @@ -112,7 +113,7 @@ index 3f0a3b2133f0d48054f33df28b93a9ee40d7ed78..801bf4b1090a8f0de922fdac6c4145c2
sandbox::policy::switches::kDisableSeccompFilterSandbox,
sandbox::policy::switches::kNoSandbox,
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..b4ddafdd126edd16172f00448bbbd56eaf509b1f 100644
index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..35b0bb908245330fbdc5205caa3299bf6fd8f7b4 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -4,6 +4,7 @@
Expand All @@ -131,7 +132,18 @@ index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..b4ddafdd126edd16172f00448bbbd56e

namespace blink {

@@ -118,6 +120,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
@@ -19,6 +21,10 @@ namespace blink {
// Level 4 specification.
gfx::ColorSpace PredefinedColorSpaceToGfxColorSpace(
PredefinedColorSpace color_space) {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ return gfx::ColorSpace();
+ }
switch (color_space) {
case PredefinedColorSpace::kSRGB:
return gfx::ColorSpace::CreateSRGB();
@@ -118,6 +124,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
}

gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
Expand Down
2 changes: 1 addition & 1 deletion patches/node/build_add_gn_build_files.patch
Expand Up @@ -1834,7 +1834,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
+ args = rebase_path(inputs + outputs, root_build_dir)
+}
diff --git a/src/node_version.h b/src/node_version.h
index 39f6406dd2b52e16a2be5c00c554da30a806ead9..36117c5b36c65f0a8a9bb9c421bc74b82f2b1f3a 100644
index 0f1a9b52cccba1e54150494a7ee5b28961a8d59d..bb68b2dfef4a693d8a1d0fe056fe696254d12d09 100644
--- a/src/node_version.h
+++ b/src/node_version.h
@@ -89,7 +89,10 @@
Expand Down
Expand Up @@ -45,10 +45,10 @@ index bdfe81d11cc50f492c93fe48f6946765b6fb5238..ca08deeb19f5fe9ee399ad809b24579f
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
}],
diff --git a/configure.py b/configure.py
index 95b31769cb5756578d66193716c638f504bd44aa..fe741d15da821396883dd72b4e0a42c7758bd557 100755
index fed2688c792486e5f86509eea0dd6d45f749a99d..426afed7cd0a3a403d4b753af0b25f55024d0f71 100755
--- a/configure.py
+++ b/configure.py
@@ -1433,6 +1433,7 @@ def configure_v8(o):
@@ -1439,6 +1439,7 @@ def configure_v8(o):
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
Expand Down
5 changes: 2 additions & 3 deletions script/release/release.js
Expand Up @@ -128,9 +128,8 @@ function assetsForVersion (version, validatingRelease) {
`electron-${version}-mas-arm64-dsym-snapshot.zip`,
`electron-${version}-mas-arm64-symbols.zip`,
`electron-${version}-mas-arm64.zip`,
// TODO(vertedinde) Symbol generation on 32-bit Windows is temporarily disabled due to CI failures
// `electron-${version}-win32-ia32-pdb.zip`,
// `electron-${version}-win32-ia32-symbols.zip`,
`electron-${version}-win32-ia32-pdb.zip`,
`electron-${version}-win32-ia32-symbols.zip`,
`electron-${version}-win32-ia32.zip`,
`electron-${version}-win32-x64-pdb.zip`,
`electron-${version}-win32-x64-symbols.zip`,
Expand Down
14 changes: 6 additions & 8 deletions script/release/uploaders/upload.py
Expand Up @@ -76,10 +76,9 @@ def main():
shutil.copy2(os.path.join(OUT_DIR, 'dist.zip'), electron_zip)
upload_electron(release, electron_zip, args)
if get_target_arch() != 'mips64el':
if (get_target_arch() != 'ia32' or PLATFORM != 'win32'):
symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
upload_electron(release, symbols_zip, args)
symbols_zip = os.path.join(OUT_DIR, SYMBOLS_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'symbols.zip'), symbols_zip)
upload_electron(release, symbols_zip, args)
if PLATFORM == 'darwin':
if get_platform_key() == 'darwin' and get_target_arch() == 'x64':
api_path = os.path.join(ELECTRON_DIR, 'electron-api.json')
Expand All @@ -96,10 +95,9 @@ def main():
shutil.copy2(os.path.join(OUT_DIR, 'dsym-snapshot.zip'), dsym_snapshot_zip)
upload_electron(release, dsym_snapshot_zip, args)
elif PLATFORM == 'win32':
if get_target_arch() != 'ia32':
pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
upload_electron(release, pdb_zip, args)
pdb_zip = os.path.join(OUT_DIR, PDB_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'pdb.zip'), pdb_zip)
upload_electron(release, pdb_zip, args)
elif PLATFORM == 'linux':
debug_zip = os.path.join(OUT_DIR, DEBUG_NAME)
shutil.copy2(os.path.join(OUT_DIR, 'debug.zip'), debug_zip)
Expand Down
14 changes: 8 additions & 6 deletions shell/browser/electron_browser_main_parts.cc
Expand Up @@ -278,12 +278,6 @@ void ElectronBrowserMainParts::PostEarlyInitialization() {
}

int ElectronBrowserMainParts::PreCreateThreads() {
#if defined(USE_AURA)
if (!display::Screen::GetScreen()) {
screen_ = views::CreateDesktopScreen();
}
#endif

if (!views::LayoutProvider::Get())
layout_provider_ = std::make_unique<views::LayoutProvider>();

Expand Down Expand Up @@ -314,6 +308,14 @@ int ElectronBrowserMainParts::PreCreateThreads() {
// Load resources bundle according to locale.
std::string loaded_locale = LoadResourceBundle(locale);

#if defined(USE_AURA)
// NB: must be called _after_ locale resource bundle is loaded,
// because ui lib makes use of it in X11
if (!display::Screen::GetScreen()) {
screen_ = views::CreateDesktopScreen();
}
#endif

// Initialize the app locale.
std::string app_locale = l10n_util::GetApplicationLocale(loaded_locale);
ElectronBrowserClient::SetApplicationLocale(app_locale);
Expand Down
1 change: 0 additions & 1 deletion shell/browser/native_window_views.cc
Expand Up @@ -729,7 +729,6 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bounds, bool animate) {
#if BUILDFLAG(IS_WIN)
if (is_moving_ || is_resizing_) {
pending_bounds_change_ = bounds;
return;
}
#endif

Expand Down
1 change: 1 addition & 0 deletions shell/browser/native_window_views.h
Expand Up @@ -225,6 +225,7 @@ class NativeWindowViews : public NativeWindow,

#if BUILDFLAG(IS_WIN)
void HandleSizeEvent(WPARAM w_param, LPARAM l_param);
void ResetWindowControls();
void SetForwardMouseMessages(bool forward);
static LRESULT CALLBACK SubclassProc(HWND hwnd,
UINT msg,
Expand Down

0 comments on commit 85aa2fc

Please sign in to comment.