diff --git a/pkgs/development/tools/electron/common.nix b/pkgs/development/tools/electron/common.nix index ea2ec1579b31..fe2b81e7ad8d 100644 --- a/pkgs/development/tools/electron/common.nix +++ b/pkgs/development/tools/electron/common.nix @@ -66,7 +66,11 @@ in src = null; - patches = base.patches; + patches = + base.patches + ++ lib.optionals (lib.versions.major info.version == "32") [ + ./fix-electron-32-patch-apply-without-git-3way.patch + ]; unpackPhase = '' diff --git a/pkgs/development/tools/electron/fix-electron-32-patch-apply-without-git-3way.patch b/pkgs/development/tools/electron/fix-electron-32-patch-apply-without-git-3way.patch new file mode 100644 index 000000000000..d586c69b6871 --- /dev/null +++ b/pkgs/development/tools/electron/fix-electron-32-patch-apply-without-git-3way.patch @@ -0,0 +1,73 @@ +diff --git a/electron/patches/chromium/fix_osr_stutter_in_both_cpu_and_gpu_capture_when_page_has_animation.patch b/electron/patches/chromium/fix_osr_stutter_in_both_cpu_and_gpu_capture_when_page_has_animation.patch +index a8d4bc910..1d9b97e5f 100644 +--- a/electron/patches/chromium/fix_osr_stutter_in_both_cpu_and_gpu_capture_when_page_has_animation.patch ++++ b/electron/patches/chromium/fix_osr_stutter_in_both_cpu_and_gpu_capture_when_page_has_animation.patch +@@ -10,10 +10,10 @@ The upstream has a fix, which will be available in Chromium M135. + Backport this fix for Electron versions before that. + + diff --git a/media/capture/content/video_capture_oracle.cc b/media/capture/content/video_capture_oracle.cc +-index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d7b454630 100644 ++index 43a35d394ee045f78ffecfeea582300b4083091f..ae0cdf0dcda5df71df55776f0842071eaa1b87da 100644 + --- a/media/capture/content/video_capture_oracle.cc + +++ b/media/capture/content/video_capture_oracle.cc +-@@ -118,8 +118,9 @@ void VideoCaptureOracle::SetCaptureSizeConstraints( ++@@ -113,8 +113,9 @@ void VideoCaptureOracle::SetCaptureSizeConstraints( + void VideoCaptureOracle::SetAutoThrottlingEnabled(bool enabled) { + const bool was_enabled = + (capture_size_throttling_mode_ != kThrottlingDisabled); +@@ -24,7 +24,7 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + capture_size_throttling_mode_ = + enabled ? kThrottlingEnabled : kThrottlingDisabled; + VLOG(1) << "Capture size auto-throttling is now " +-@@ -127,19 +128,22 @@ void VideoCaptureOracle::SetAutoThrottlingEnabled(bool enabled) { ++@@ -122,19 +123,22 @@ void VideoCaptureOracle::SetAutoThrottlingEnabled(bool enabled) { + + // When not auto-throttling, have the CaptureResolutionChooser target the max + // resolution within constraints. +@@ -51,7 +51,7 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + } + + bool VideoCaptureOracle::ObserveEventAndDecideCapture( +-@@ -172,6 +176,15 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture( ++@@ -167,6 +171,15 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture( + if (should_sample) { + event_time = content_sampler_.frame_timestamp(); + duration_of_next_frame_ = content_sampler_.sampling_period(); +@@ -67,8 +67,8 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + } + last_time_animation_was_detected_ = event_time; + } else { +-@@ -198,8 +211,9 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture( +- NOTREACHED(); ++@@ -194,8 +207,9 @@ bool VideoCaptureOracle::ObserveEventAndDecideCapture( ++ break; + } + + - if (!should_sample) +@@ -78,7 +78,7 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + + // If the exact duration of the next frame has not been determined, estimate + // it using the difference between the current and last frame. +-@@ -373,16 +387,18 @@ void VideoCaptureOracle::RecordConsumerFeedback( ++@@ -369,16 +383,18 @@ void VideoCaptureOracle::RecordConsumerFeedback( + + // resource_utilization feedback. + +@@ -99,7 +99,7 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + + if (capture_size_throttling_mode_ != kThrottlingActive) { + VLOG(1) << "Received consumer feedback at frame #" << frame_number +-@@ -553,12 +569,14 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) { ++@@ -549,12 +565,14 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) { + const int current_area = capture_size_.GetArea(); + const int increased_area = + resolution_chooser_.FindLargerFrameSize(current_area, 1).GetArea(); +@@ -116,7 +116,7 @@ index dad9598799a670b3cfb14965bc8a7b4ea3b4f95f..05a82788ae1e5c304ee150a2390f346d + if (buffer_pool_utilization_.current() > 0.0) { + const int buffer_capable_area = base::saturated_cast( + current_area / buffer_pool_utilization_.current()); +-@@ -593,8 +611,9 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) { ++@@ -589,8 +607,9 @@ int VideoCaptureOracle::AnalyzeForIncreasedArea(base::TimeTicks analyze_time) { + + // At this point, the system is currently under-utilized. Reset the start + // time if the system was not under-utilized when the last analysis was made. diff --git a/pkgs/development/tools/electron/info.json b/pkgs/development/tools/electron/info.json index 1a1fcb674405..d6e8f5f3a717 100644 --- a/pkgs/development/tools/electron/info.json +++ b/pkgs/development/tools/electron/info.json @@ -47,10 +47,10 @@ }, "src/electron": { "fetcher": "fetchFromGitHub", - "hash": "sha256-3W6F30x90mLX1BdL9zY/YLShFRUGirokadzEg5QX6TU=", + "hash": "sha256-UpLk6Kjd50UHcUV53Gz7KnnXk8T2nd4Oc2FW7CFdL04=", "owner": "electron", "repo": "electron", - "rev": "v32.3.1" + "rev": "v32.3.2" }, "src/media/cdm/api": { "fetcher": "fetchFromGitiles", @@ -938,7 +938,7 @@ "electron_yarn_hash": "122y1vnizwg0rwz8qf37mvpa0i78141y98wn4h11l6b9gyshrs65", "modules": "128", "node": "20.18.1", - "version": "32.3.1" + "version": "32.3.2" }, "33": { "chrome": "130.0.6723.191",