helloadhavan/github_issues huggingface dataset:
Repository: electron/electron
Pull request: ci: fixup mac runners

Backport of #47877

See that PR for details.


Notes: <!-- Please add a one-line description for app developers to read in the release notes, or 'none' if no notes relevant to app developers. Examples and help on special cases: https://github.com/electron/clerk/blob/main/README.md#examples -->none


Changed files:
filename: .github/actions/free-space-macos/action.yml
patch: @@ -6,6 +6,8 @@ runs:
     - name: Free Space on MacOS
       shell: bash
       run: |
+        echo "Disk usage before cleanup:"
+        df -h
         sudo mkdir -p $TMPDIR/del-target
 
         tmpify() {
@@ -62,4 +64,5 @@ runs:
 
         # lipo off some huge binaries arm64 versions to save space
         strip_universal_deep $(xcode-select -p)/../SharedFrameworks
-        # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
\ No newline at end of file
+        # strip_arm_deep /System/Volumes/Data/Library/Developer/CommandLineTools/usr
+        sudo mdutil -a -i off

filename: .github/workflows/pipeline-segment-electron-test.yml
patch: @@ -103,6 +103,8 @@ jobs:
             "'kTCCServiceCamera','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
             "'kTCCServiceBluetoothAlways','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
             "'kTCCServiceAppleEvents','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+            "'kTCCServiceCamera',' /opt/hca/hosted-compute-agent',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
+            "'kTCCServiceBluetoothAlways',' /opt/hca/hosted-compute-agent',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159"
         )
         for values in "${userValuesArray[@]}"; do
           # Sonoma and higher have a few extra values

filename: spec/chromium-spec.ts
patch: @@ -3089,7 +3089,7 @@ describe('iframe using HTML fullscreen API while window is OS-fullscreened', ()
   });
 });
 
-ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.serial', () => {
+describe('navigator.serial', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
@@ -3113,6 +3113,7 @@ ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator
   });
 
   it('does not return a port if select-serial-port event is not defined', async () => {
+    // Take screenshot to verify the test is running
     w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
     const port = await getPorts();
     expect(port).to.equal(notFoundError);
@@ -3629,7 +3630,7 @@ ifdescribe((process.platform !== 'linux' || app.isUnityRunning()))('navigator.se
   });
 });
 
-ifdescribe(process.platform !== 'darwin' || process.arch !== 'arm64')('navigator.bluetooth', () => {
+describe('navigator.bluetooth', () => {
   let w: BrowserWindow;
   before(async () => {
     w = new BrowserWindow({
Repository: ollama/ollama
Pull request: re-add system context

Fixes #4383

Changed files:
filename: cmd/interactive.go
patch: @@ -292,6 +292,10 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
 			continue
 		case strings.HasPrefix(line, "/clear"):
 			opts.Messages = []api.Message{}
+			if opts.System != "" {
+				newMessage := api.Message{Role: "system", Content: opts.System}
+				opts.Messages = append(opts.Messages, newMessage)
+			}
 			fmt.Println("Cleared session context")
 			continue
 		case strings.HasPrefix(line, "/set"):
Repository: huggingface/transformers
Pull request: extend bitnet cases to xpu, all 8 cases pass

@ydshieh, pls help review, thx very much.

Changed files:
filename: tests/quantization/bitnet_integration/test_bitnet.py
patch: @@ -25,7 +25,7 @@
 from transformers.testing_utils import (
     backend_empty_cache,
     require_accelerate,
-    require_torch_gpu,
+    require_torch_accelerator,
     slow,
     torch_device,
 )
@@ -39,7 +39,7 @@
     from accelerate import init_empty_weights
 
 
-@require_torch_gpu
+@require_torch_accelerator
 class BitNetQuantConfigTest(unittest.TestCase):
     def test_to_dict(self):
         """
@@ -53,7 +53,7 @@ def test_to_dict(self):
 
 
 @slow
-@require_torch_gpu
+@require_torch_accelerator
 @require_accelerate
 class BitNetTest(unittest.TestCase):
     model_name = "HF1BitLLM/Llama3-8B-1.58-100B-tokens"
@@ -197,7 +197,7 @@ def forward(self, x):
 
 
 @slow
-@require_torch_gpu
+@require_torch_accelerator
 @require_accelerate
 class BitNetSerializationTest(unittest.TestCase):
     def test_model_serialization(self):
Repository: facebook/react
Pull request: Turn on lazy context propagation for RN and RTR

Following https://github.com/facebook/react/pull/30935 let's turn this on across the board so we can clean up experiments in RN.

Changed files:
filename: packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
patch: @@ -25,5 +25,4 @@ export const enablePersistedModeClonedFlag = __VARIANT__;
 export const enableShallowPropDiffing = __VARIANT__;
 export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
 export const enableFabricCompleteRootInCommitPhase = __VARIANT__;
-export const enableLazyContextPropagation = __VARIANT__;
 export const enableSiblingPrerendering = __VARIANT__;

filename: packages/shared/forks/ReactFeatureFlags.native-fb.js
patch: @@ -27,7 +27,6 @@ export const {
   enablePersistedModeClonedFlag,
   enableShallowPropDiffing,
   passChildrenWhenCloningPersistedNodes,
-  enableLazyContextPropagation,
   enableSiblingPrerendering,
 } = dynamicFlags;
 
@@ -63,6 +62,7 @@ export const enableGetInspectorDataForInstanceInProduction = true;
 export const enableHalt = false;
 export const enableInfiniteRenderLoopDetection = true;
 export const enableContextProfiling = false;
+export const enableLazyContextPropagation = true;
 export const enableLegacyCache = false;
 export const enableLegacyFBSupport = false;
 export const enableLegacyHidden = false;

filename: packages/shared/forks/ReactFeatureFlags.native-oss.js
patch: @@ -52,7 +52,7 @@ export const enableGetInspectorDataForInstanceInProduction = false;
 export const enableHalt = false;
 export const enableHiddenSubtreeInsertionEffectCleanup = false;
 export const enableInfiniteRenderLoopDetection = true;
-export const enableLazyContextPropagation = false;
+export const enableLazyContextPropagation = true;
 export const enableContextProfiling = false;
 export const enableLegacyCache = false;
 export const enableLegacyFBSupport = false;

filename: packages/shared/forks/ReactFeatureFlags.test-renderer.js
patch: @@ -55,7 +55,7 @@ export const syncLaneExpirationMs = 250;
 export const transitionLaneExpirationMs = 5000;
 
 export const disableSchedulerTimeoutInWorkLoop = false;
-export const enableLazyContextPropagation = __EXPERIMENTAL__;
+export const enableLazyContextPropagation = true;
 export const enableContextProfiling = false;
 export const enableLegacyHidden = false;
 

filename: packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
patch: @@ -42,7 +42,7 @@ export const enableFlightReadableStream = true;
 export const enableGetInspectorDataForInstanceInProduction = false;
 export const enableHalt = false;
 export const enableInfiniteRenderLoopDetection = true;
-export const enableLazyContextPropagation = false;
+export const enableLazyContextPropagation = true;
 export const enableContextProfiling = false;
 export const enableHiddenSubtreeInsertionEffectCleanup = true;
 export const enableLegacyCache = false;
Repository: ollama/ollama
Pull request: Don't return error on signal exit


Changed files:
filename: server/routes.go
patch: @@ -1086,7 +1086,7 @@ func Serve(ln net.Listener) error {
 		return err
 	}
 	<-ctx.Done()
-	return err
+	return nil
 }
 
 func waitForStream(c *gin.Context, ch chan interface{}) {
Repository: denoland/deno
Pull request: fix(ext/node): fix IPC stdio handling in child_process

## Summary

Two fixes for child_process IPC stdio handling:

1. **Validate single IPC pipe** - throw `ERR_IPC_ONE_PIPE` when multiple `'ipc'` entries are specified in the stdio array (e.g. `stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'ipc']`)

2. **Fix panic with IPC in non-default stdio position** - using `'ipc'` in stdio positions like `stdio: ['inherit', 'ipc', 'inherit']` caused a panic (`unreachable!()` in `Stdio::as_stdio()`). `IpcForInternalUse` now correctly maps to a piped stdio.

## Test plan

- [x] `./x test-compat test-child-process-stdio.js` passes (was failing)
- [x] `./x test-compat test-child-process-stdout-ipc.js` passes (was panicking)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Changed files:
filename: ext/node/polyfills/internal/child_process.ts
patch: @@ -46,6 +46,7 @@ import {
   ERR_INVALID_HANDLE_TYPE,
   ERR_INVALID_SYNC_FORK_INPUT,
   ERR_IPC_CHANNEL_CLOSED,
+  ERR_IPC_ONE_PIPE,
   ERR_IPC_SYNC_FORK,
   ERR_MISSING_ARGS,
   ERR_UNKNOWN_SIGNAL,
@@ -382,6 +383,9 @@ export class ChildProcess extends EventEmitter {
     this.spawnargs = [cmd, ...cmdArgs];
 
     const ipc = normalizedStdio.indexOf("ipc");
+    if (ipc !== -1 && normalizedStdio.indexOf("ipc", ipc + 1) !== -1) {
+      throw new ERR_IPC_ONE_PIPE();
+    }
 
     const extraStdioOffset = 3; // stdin, stdout, stderr
 

filename: ext/process/lib.rs
patch: @@ -72,7 +72,8 @@ impl Stdio {
       Stdio::Inherit => StdStdio::inherit(),
       Stdio::Piped => StdStdio::piped(),
       Stdio::Null => StdStdio::null(),
-      _ => unreachable!(),
+      // IPC uses a pipe internally
+      Stdio::IpcForInternalUse => StdStdio::piped(),
     }
   }
 }

filename: tests/node_compat/config.jsonc
patch: @@ -266,7 +266,9 @@
     "parallel/test-child-process-stdio-big-write-end.js": {},
     "parallel/test-child-process-stdio-inherit.js": {},
     "parallel/test-child-process-stdio-overlapped.js": {},
+    "parallel/test-child-process-stdio.js": {},
     "parallel/test-child-process-stdout-flush-exit.js": {},
+    "parallel/test-child-process-stdout-ipc.js": {},
     "parallel/test-child-process-stdout-flush.js": {},
     "parallel/test-child-process-uid-gid.js": {},
     "parallel/test-child-process-validate-stdio.js": {},
Repository: vercel/next.js
Pull request: Turbopack: make tracing warning not fail build

It called "warning", but it had severity error.

Closes PACK-5708

Changed files:
filename: turbopack/crates/turbopack-ecmascript/src/references/raw.rs
patch: @@ -304,7 +304,7 @@ impl Issue for TooManyMatchesWarning {
     }
 
     fn severity(&self) -> IssueSeverity {
-        IssueSeverity::Error
+        IssueSeverity::Warning
     }
 
     #[turbo_tasks::function]
Repository: ggml-org/llama.cpp
Pull request: quantize: prevent input/output file collision

## Summary
- Add check to prevent quantizing when input and output files are the same
- Uses `std::filesystem::equivalent()` to handle path variations (e.g., `./file` vs `file`)
- Prevents file corruption caused by mmap reading from a file being simultaneously written

## Test
```bash
# Before fix: file gets corrupted (19MB -> 727KB)
llama-quantize model.gguf model.gguf Q4_0

# After fix: clean error message, file preserved
main: error: input and output files are the same: 'model.gguf'
```

Fixes #12753

Changed files:
filename: tools/quantize/quantize.cpp
patch: @@ -12,6 +12,7 @@
 #include <cmath>
 #include <cctype>
 #include <algorithm>
+#include <filesystem>
 
 struct quant_option {
     std::string name;
@@ -643,6 +644,11 @@ int main(int argc, char ** argv) {
         return 1;
     }
 
+    if (std::error_code ec; std::filesystem::equivalent(fname_inp, fname_out, ec)) {
+        fprintf(stderr, "%s: error: input and output files are the same: '%s'\n", __func__, fname_inp.c_str());
+        return 1;
+    }
+
     print_build_info();
 
     fprintf(stderr, "%s: quantizing '%s' to '%s' as %s", __func__, fname_inp.c_str(), fname_out.c_str(), ftype_str.c_str());
Repository: ggml-org/llama.cpp
Pull request: convert : lint fix

Fix linting after #18470

Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -9304,6 +9304,7 @@ def tensor_force_quant(self, name, new_name, bid, n_dims):
             return gguf.GGMLQuantizationType.F32
         return super().tensor_force_quant(name, new_name, bid, n_dims)
 
+
 @ModelBase.register("FalconH1ForCausalLM")
 class FalconH1Model(Mamba2Model):
     model_arch = gguf.MODEL_ARCH.FALCON_H1
Repository: vercel/next.js
Pull request: [ci]: increase number of runners for test jobs

This bumps the parallelization as we've been seeing timeouts / long running jobs. It's better for us to distribute a smaller number of tests to more machines to optimize for walltime. Ideally we end up with runners finishing quicker and if we introduce queueing, it's a problem that we can throw more CI compute at. 

Changed files:
filename: .github/workflows/build_and_test.yml
patch: @@ -240,7 +240,7 @@ jobs:
         exclude:
           # Excluding React 18 tests unless on `canary` branch until budget is approved.
           - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
-        group: [1/5, 2/5, 3/5, 4/5, 5/5]
+        group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
         # Empty value uses default
         react: ['', '18.3.1']
     uses: ./.github/workflows/build_reusable.yml
@@ -323,7 +323,7 @@ jobs:
     strategy:
       fail-fast: false
       matrix:
-        group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
+        group: [1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 10/10]
         # Empty value uses default
         # TODO: Run with React 18.
         # Integration tests use the installed React version in next/package.json.
@@ -725,7 +725,7 @@ jobs:
         exclude:
           # Excluding React 18 tests unless on `canary` branch until budget is approved.
           - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
-        group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6]
+        group: [1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 10/10]
         # Empty value uses default
         react: ['', '18.3.1']
     uses: ./.github/workflows/build_reusable.yml
@@ -838,7 +838,7 @@ jobs:
         exclude:
           # Excluding React 18 tests unless on `canary` branch until budget is approved.
           - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }}
-        group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7]
+        group: [1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 10/10]
         # Empty value uses default
         react: ['', '18.3.1']
     uses: ./.github/workflows/build_reusable.yml
Repository: facebook/react
Pull request: [dependabot] Ignore all fixture directories

Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom):
* __->__ #31074
* #31073

Seems like we can specify a wildcard dependency name to ignore all
dependencies from being updated. As I understand it dependabot will
still run monthly but no PRs will be generated.

Changed files:
filename: .github/dependabot.yml
patch: @@ -1,7 +1,8 @@
 version: 2
 updates:
   - package-ecosystem: "npm"
-    directories: "/fixtures/*"
+    directories:
+      - "/fixtures/*"
     schedule:
       interval: "monthly"
     open-pull-requests-limit: 0
Repository: ollama/ollama
Pull request: llm: dont cap context window limit to training context window

Some models such as the new Llama 3 8B context window fine tunes support larger context windows such as 128k, 256k. However, the "training" context window is still 8k. To avoid confusion, this change loosens the limit and logs a warning.

Changed files:
filename: llm/server.go
patch: @@ -73,8 +73,7 @@ func LoadModel(model string) (*GGML, error) {
 func NewLlamaServer(gpus gpu.GpuInfoList, model string, ggml *GGML, adapters, projectors []string, opts api.Options) (LlamaServer, error) {
 	var err error
 	if opts.NumCtx > int(ggml.KV().ContextLength()) {
-		slog.Warn("requested context length is greater than model max context length", "requested", opts.NumCtx, "model", ggml.KV().ContextLength())
-		opts.NumCtx = int(ggml.KV().ContextLength())
+		slog.Warn("requested context length is greater than the model's training context window size", "requested", opts.NumCtx, "training size", ggml.KV().ContextLength())
 	}
 
 	if opts.NumCtx < 4 {
Repository: vercel/next.js
Pull request: [Cache Components] Use canary React when only Cache Components is enabled

Cache Components previously relied upon experimental only features in React however now that partial prerendering in React is stabilized we can now use the canary channel. There are still some features that require experimental such as taint but for Cache Components by default we should use canary.

Changed files:
filename: crates/next-core/src/next_import_map.rs
patch: @@ -128,12 +128,11 @@ pub async fn get_next_client_import_map(
         ClientContextType::Pages { .. } => {}
         ClientContextType::App { app_dir } => {
             // Keep in sync with file:///./../../../packages/next/src/lib/needs-experimental-react.ts
-            let react_flavor =
-                if *next_config.enable_ppr().await? || *next_config.enable_taint().await? {
-                    "-experimental"
-                } else {
-                    ""
-                };
+            let react_flavor = if *next_config.enable_taint().await? {
+                "-experimental"
+            } else {
+                ""
+            };
 
             import_map.insert_exact_alias(
                 rcstr!("react"),
@@ -830,9 +829,8 @@ async fn apply_vendored_react_aliases_server(
     runtime: NextRuntime,
     next_config: Vc<NextConfig>,
 ) -> Result<()> {
-    let ppr = *next_config.enable_ppr().await?;
     let taint = *next_config.enable_taint().await?;
-    let react_channel = if ppr || taint { "-experimental" } else { "" };
+    let react_channel = if taint { "-experimental" } else { "" };
     let react_condition = if ty.should_use_react_server_condition() {
         "server"
     } else {

filename: packages/next/src/lib/needs-experimental-react.ts
patch: @@ -2,6 +2,6 @@ import type { NextConfig } from '../server/config-shared'
 
 // Keep in sync with Turbopack's experimental React switch: file://./../../../../crates/next-core/src/next_import_map.rs
 export function needsExperimentalReact(config: NextConfig) {
-  const { ppr, taint } = config.experimental || {}
-  return Boolean(ppr || taint)
+  const { taint } = config.experimental || {}
+  return Boolean(taint)
 }
Repository: huggingface/transformers
Pull request: Fix Qwen2Audio flash attention mask format for generation

## What does this PR fix?

This PR fixes the `test_eager_matches_fa2_generate` test failure for Qwen2Audio by using the `create_bidirectional_mask` utility function to properly handle attention masks across different attention implementations.

The Qwen2Audio model was manually creating a 4D attention mask with `-inf` values for the audio encoder, regardless of the attention implementation being used. This caused issues with Flash Attention 2/3, which requires a 2D boolean mask (shape `(batch_size, seq_len)`) with `1` for valid tokens and `0` for padding.

Changed files:
filename: src/transformers/models/qwen2_audio/modeling_qwen2_audio.py
patch: @@ -25,6 +25,7 @@
 from ...activations import ACT2FN
 from ...cache_utils import Cache
 from ...generation import GenerationMixin
+from ...masking_utils import create_bidirectional_mask
 from ...modeling_layers import GradientCheckpointingLayer
 from ...modeling_outputs import BaseModelOutput, ModelOutput
 from ...modeling_utils import ALL_ATTENTION_FUNCTIONS, PreTrainedModel
@@ -774,14 +775,19 @@ def forward(
                 lengths_expand = audio_feat_lengths.unsqueeze(1).expand(batch_size, max_seq_len)
                 # Create mask
                 padding_mask = seq_range >= lengths_expand
+                audio_attention_mask_2d = (~padding_mask).to(dtype=torch.long, device=audio_feat_lengths.device)
 
-                audio_attention_mask_ = padding_mask.view(batch_size, 1, 1, max_seq_len).expand(
-                    batch_size, 1, max_seq_len, max_seq_len
+                dummy_embeds = torch.zeros(
+                    (batch_size, max_seq_len, 1),
+                    dtype=inputs_embeds.dtype,
+                    device=inputs_embeds.device,
                 )
-                audio_attention_mask = audio_attention_mask_.to(
-                    dtype=self.audio_tower.conv1.weight.dtype, device=self.audio_tower.conv1.weight.device
+
+                audio_attention_mask = create_bidirectional_mask(
+                    config=self.audio_tower.config,
+                    input_embeds=dummy_embeds,
+                    attention_mask=audio_attention_mask_2d,
                 )
-                audio_attention_mask[audio_attention_mask_] = float("-inf")
 
                 audio_outputs = self.audio_tower(input_features, attention_mask=audio_attention_mask)
                 selected_audio_feature = audio_outputs.last_hidden_state
Repository: electron/electron
Pull request: fix: window content protection on older Windows versions

Backport of #47856

See that PR for details.


Notes: Fixed an issue on some older Windows versions where `setContentProtection` didn't work as expected.


Changed files:
filename: shell/browser/native_window_views.cc
patch: @@ -1263,12 +1263,7 @@ void NativeWindowViews::SetOpacity(const double opacity) {
 #if BUILDFLAG(IS_WIN)
   const double boundedOpacity = std::clamp(opacity, 0.0, 1.0);
   HWND hwnd = GetAcceleratedWidget();
-  if (!layered_) {
-    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
-    ex_style |= WS_EX_LAYERED;
-    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
-    layered_ = true;
-  }
+  SetLayered();
   ::SetLayeredWindowAttributes(hwnd, 0, boundedOpacity * 255, LWA_ALPHA);
   opacity_ = boundedOpacity;
 #else
@@ -1702,6 +1697,16 @@ void NativeWindowViews::UpdateThickFrame() {
     FlipWindowStyle(GetAcceleratedWidget(), resizable_, WS_THICKFRAME);
   }
 }
+
+void NativeWindowViews::SetLayered() {
+  HWND hwnd = GetAcceleratedWidget();
+  if (!layered_) {
+    LONG ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
+    ex_style |= WS_EX_LAYERED;
+    ::SetWindowLong(hwnd, GWL_EXSTYLE, ex_style);
+    layered_ = true;
+  }
+}
 #endif
 
 void NativeWindowViews::OnWidgetActivationChanged(views::Widget* changed_widget,

filename: shell/browser/native_window_views.h
patch: @@ -170,6 +170,7 @@ class NativeWindowViews : public NativeWindow,
 #if BUILDFLAG(IS_WIN)
   TaskbarHost& taskbar_host() { return taskbar_host_; }
   void UpdateThickFrame();
+  void SetLayered();
 #endif
 
   SkColor overlay_button_color() const { return overlay_button_color_; }

filename: shell/browser/ui/win/electron_desktop_window_tree_host_win.cc
patch: @@ -167,6 +167,11 @@ void ElectronDesktopWindowTreeHostWin::UpdateAllowScreenshots() {
   if (allowed == allow_screenshots_)
     return;
 
+  // On some older Windows versions, setting the display affinity
+  // to WDA_EXCLUDEFROMCAPTURE won't prevent the window from being
+  // captured - setting WS_EX_LAYERED mitigates this issue.
+  if (base::win::GetVersion() < base::win::Version::WIN11_22H2)
+    native_window_view_->SetLayered();
   ::SetWindowDisplayAffinity(
       GetAcceleratedWidget(),
       allow_screenshots_ ? WDA_NONE : WDA_EXCLUDEFROMCAPTURE);