helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: [compiler] Make CompilerError compatible with reflection


In #32416, @michaelfaith discovered that https://github.com/facebook/react/blob/029e8bd618af23fbdd9efdac565ad81f7d4640d8/scripts/jest/setupTests.js#L82 would fail on the merged compiler eslint rule.

Upon further investigation I discovered that our CompilerError implementation doesn't play nicely with Reflect, so `Reflect.construct` would fail as `.toString` would error:

```
TypeError: Cannot read properties of undefined (reading 'map')
          at _CompilerError.toString (/Users/.../code/react/node_modules/babel-plugin-react-compiler/src/CompilerError.ts:200:25)
          at _CompilerError.get message [as message] (/Users/.../code/react/node_modules/babel-plugin-react-compiler/src/CompilerError.ts:194:17)
          at Object.construct (/Users/.../code/react/scripts/jest/setupTests.js:153:52)
```

I tested this fix using my local copy of the built babel-plugin-react-compiler to verify that this fixes those tests.


Changed files:
filename: compiler/packages/babel-plugin-react-compiler/src/CompilerError.ts
patch: @@ -188,6 +188,7 @@ export class CompilerError extends Error {
   constructor(...args: Array<any>) {
     super(...args);
     this.name = 'ReactCompilerError';
+    this.details = [];
   }
 
   override get message(): string {
@@ -197,7 +198,10 @@ export class CompilerError extends Error {
   override set message(_message: string) {}
 
   override toString(): string {
-    return this.details.map(detail => detail.toString()).join('\n\n');
+    if (Array.isArray(this.details)) {
+      return this.details.map(detail => detail.toString()).join('\n\n');
+    }
+    return this.name;
   }
 
   push(options: CompilerErrorDetailOptions): CompilerErrorDetail {
Repository: vuejs/vue
Pull request: fix v-on unit test

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [x] Bugfix
- [ ] Feature
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

It seems that the previous way is unable to change the value of input.checked, so input.checked will not equal to true even if when after removing the prevent modifier.

Changed files:
filename: test/unit/features/directives/on.spec.js
patch: @@ -1,11 +1,10 @@
 import Vue from 'vue'
 
 describe('Directive v-on', () => {
-  let vm, spy, spy2, el
+  let vm, spy, el
 
   beforeEach(() => {
     spy = jasmine.createSpy()
-    spy2 = jasmine.createSpy()
     el = document.createElement('div')
     document.body.appendChild(el)
   })
@@ -88,12 +87,15 @@ describe('Directive v-on', () => {
       template: `
         <input type="checkbox" ref="input" @click.prevent="foo">
       `,
-      methods: { foo: spy2 }
+      methods: {
+        foo ($event) {
+          spy($event.defaultPrevented)
+        }
+      }
     })
     vm.$refs.input.checked = false
     triggerEvent(vm.$refs.input, 'click')
-    expect(spy2).toHaveBeenCalled()
-    expect(vm.$refs.input.checked).toBe(false)
+    expect(spy).toHaveBeenCalledWith(true)
   })
 
   it('should support capture', () => {
Repository: ollama/ollama
Pull request: CI: dist directories no longer present

The new buildx based build no longer leaves the dist/linux-* directories around, so we don't have to clean them up before uploading.

Changed files:
filename: .github/workflows/release.yaml
patch: @@ -623,8 +623,6 @@ jobs:
           ls -lh dist/
           (cd dist; find . -type f | xargs sha256sum > ../sha256sum.txt)
           mv sha256sum.txt dist/
-          mv dist/linux-???64 .
-          mv dist/linux-amd64-rocm .
           cat dist/sha256sum.txt
       - name: Create or update Release
         run: |
Repository: electron/electron
Pull request: fix: release mouse buttons on focus loss on Wayland

Backport of #48752

See that PR for details.

Notes: Fixed an issue on Wayland (Linux) where right-clicking in the titlebar could  break mouse interactions.

Changed files:
filename: patches/chromium/.patches
patch: @@ -139,3 +139,4 @@ feat_add_support_for_embedder_snapshot_validation.patch
 band-aid_over_an_issue_with_using_deprecated_nsopenpanel_api.patch
 inspectorpageagent_provisional_frame_speculative_fix.patch
 expose_referrerscriptinfo_hostdefinedoptionsindex.patch
+fix_release_mouse_buttons_on_focus_loss_on_wayland.patch

filename: patches/chromium/fix_release_mouse_buttons_on_focus_loss_on_wayland.patch
patch: @@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Mitchell COhen <mitch.cohen@me.com>
+Date: Sun, 2 Nov 2025 15:30:56 -0500
+Subject: fix: release mouse buttons on focus loss on Wayland
+
+Fixes an issue where the mouse flags would get stuck if you right-click
+the CSD titlebar in Wayland.
+
+Bug: 455147429
+Change-Id: I9f5a9f395b3c1d85094a40a92d40691a897dbd05
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7091872
+Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
+Reviewed-by: Kramer Ge <fangzhoug@chromium.org>
+Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#1538048}
+
+diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.cc b/ui/ozone/platform/wayland/host/wayland_event_source.cc
+index 4cc15e842b633e93f1d6654225765769eb75fffd..4e421ccbd36d4efebd43c9def5b575b7d8d5e336 100644
+--- a/ui/ozone/platform/wayland/host/wayland_event_source.cc
++++ b/ui/ozone/platform/wayland/host/wayland_event_source.cc
+@@ -336,6 +336,13 @@ void WaylandEventSource::OnPointerFocusChanged(
+     // Save new pointer location.
+     pointer_location_ = location;
+     window_manager_->SetPointerFocusedWindow(window);
++  } else {
++    // The compositor may swallow the release event for any buttons that are
++    // pressed when the window loses focus, e.g. when right-clicking the
++    // titlebar to open the system menu on GNOME.
++    if (!connection_->IsDragInProgress()) {
++      ReleasePressedPointerButtons(window, ui::EventTimeForNow());
++    }
+   }
+ 
+   auto closure = focused ? base::NullCallback()
Repository: vercel/next.js
Pull request: Stop apps/bundle-analyzer/next-env.d.ts from changing

Running `pnpm build` was constantly changing this file because our prettier config mandates different quotes.

Changed files:
filename: apps/bundle-analyzer/.gitignore
patch: @@ -0,0 +1,41 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# Dependencies
+/node_modules
+/.pnp
+.pnp.*
+.yarn/*
+!.yarn/patches
+!.yarn/plugins
+!.yarn/releases
+!.yarn/versions
+
+# Build outputs
+/build
+/.next/
+/out/
+
+# Coverage and test outputs
+/coverage
+
+# Generated content
+*.tsbuildinfo
+next-env.d.ts
+.source
+
+# Logs and debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+.pnpm-debug.log*
+
+# Environment variables
+.env*
+.env*.local
+
+# Miscellaneous
+.DS_Store
+*.pem
+
+# Deployment
+.vercel

filename: apps/bundle-analyzer/next-env.d.ts
patch: @@ -1,6 +0,0 @@
-/// <reference types="next" />
-/// <reference types="next/image-types/global" />
-import './.next/types/routes.d.ts'
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Repository: ggml-org/llama.cpp
Pull request: common : improve download error reporting

While debugging the new `cpp-httplib`, the current errors were unusable...
Here is a small patch to make life easier for the next person dealing with HTTP issues :)

Changed files:
filename: common/download.cpp
patch: @@ -305,7 +305,10 @@ static bool common_pull_file(httplib::Client & cli,
     );
 
     if (!res) {
-        LOG_ERR("%s: error during download. Status: %d\n", __func__, res ? res->status : -1);
+        LOG_ERR("%s: download failed: %s (status: %d)\n",
+                __func__,
+                httplib::to_string(res.error()).c_str(),
+                res ? res->status : -1);
         return false;
     }
Repository: facebook/react
Pull request: Set direction in animate call directly

Setting the animation's currentTime causes a quirk where the transition can end up off by a bit and the end state can be slightly off the end time.

However, I realized that we don't have to because if we just set the direction in the `animate()` call directly the Safari bug goes away.

Changed files:
filename: packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
patch: @@ -1754,7 +1754,7 @@ function animateGesture(
     moveOldFrameIntoViewport(keyframes[0]);
   }
   const reverse = rangeStart > rangeEnd;
-  const anim = targetElement.animate(keyframes, {
+  targetElement.animate(keyframes, {
     pseudoElement: pseudoElement,
     // Set the timeline to the current gesture timeline to drive the updates.
     timeline: timeline,
@@ -1764,20 +1764,14 @@ function animateGesture(
     easing: 'linear',
     // We fill in both direction for overscroll.
     fill: 'both',
+    // We play all gestures in reverse, except if we're in reverse direction
+    // in which case we need to play it in reverse of the reverse.
+    direction: reverse ? 'normal' : 'reverse',
     // Range start needs to be higher than range end. If it goes in reverse
     // we reverse the whole animation below.
     rangeStart: (reverse ? rangeEnd : rangeStart) + '%',
     rangeEnd: (reverse ? rangeStart : rangeEnd) + '%',
   });
-  if (!reverse) {
-    // We play all gestures in reverse, except if we're in reverse direction
-    // in which case we need to play it in reverse of the reverse.
-    anim.reverse();
-    // In Safari, there's a bug where the starting position isn't immediately
-    // picked up from the ScrollTimeline for one frame.
-    // $FlowFixMe[cannot-resolve-name]
-    anim.currentTime = CSS.percent(100);
-  }
 }
 
 export function startGestureTransition(
Repository: ollama/ollama
Pull request: llama: doc: explain golang objc linker warning


Changed files:
filename: docs/development.md
patch: @@ -40,6 +40,10 @@ Now you can run `ollama`:
 ./ollama
 ```
 
+#### Xcode 15 warnings
+
+If you are using Xcode newer than version 14, you may see a warning during `go build` about `ld: warning: ignoring duplicate libraries: '-lobjc'` due to Golang issue https://github.com/golang/go/issues/67799 which can be safely ignored.  You can suppress the warning with `export CGO_LDFLAGS="-Wl,-no_warn_duplicate_libraries"`
+
 ### Linux
 
 #### Linux CUDA (NVIDIA)
Repository: vercel/next.js
Pull request: Deterministic functions-config-manifest.json

This manifest wasn't deterministic across builds
```diff
 - Expected
 + Received

   {
     "version": 1,
     "functions": {
 -     "/api/pages-api/edge": {},
       "/dynamic/pages-page/edge": {},
 +     "/api/pages-api/edge": {},
       "/app-route/edge": {},
       "/force-dynamic/app-route/edge": {},
       "/app-page/edge": {},
       "/force-dynamic/app-page/edge": {}
     }
   }
   
```

Changed files:
filename: packages/next/src/build/index.ts
patch: @@ -591,9 +591,15 @@ async function writeFunctionsConfigManifest(
   distDir: string,
   manifest: FunctionsConfigManifest
 ): Promise<void> {
+  let sortedManifest: FunctionsConfigManifest = {
+    version: manifest.version,
+    functions: Object.fromEntries(
+      Object.entries(manifest.functions).sort(([a], [b]) => a.localeCompare(b))
+    ),
+  }
   await writeManifest(
     path.join(distDir, SERVER_DIRECTORY, FUNCTIONS_CONFIG_MANIFEST),
-    manifest
+    sortedManifest
   )
 }
Repository: ollama/ollama
Pull request: cache: Clear old KV cache entries when evicting a slot

When forking a cache entry, if no empty slots are available we evict the least recently used one and copy over the KV entries from the closest match. However, this copy does not overwrite existing values but only adds new ones. Therefore, we need to clear the old slot first.

This change fixes two issues:
 - The KV cache fills up and runs out of space even though we think we are managing it correctly
 - Performance gets worse over time as we use new cache entries that are not hot in the processor caches

Changed files:
filename: llama/runner/cache.go
patch: @@ -118,6 +118,7 @@ func (t *TokenCache) findCacheSlot(prompt []int) (*TokenCacheSlot, int) {
 		copy(oldestSlot.tokens, longestSlot.tokens[:longest])
 		// This is only nil for unit tests
 		if t.lc != nil {
+			t.lc.KvCacheSeqRm(oldestSlot.id, 0, -1)
 			t.lc.KvCacheSeqCp(longestSlot.id, oldestSlot.id, 0, longest)
 		}
 	}
Repository: ggml-org/llama.cpp
Pull request: fix: correct typos 'occured' and 'occurences'

Fixes minor spelling typos in comments:
- occurred (1 instance in llama.h)
- occurrences (3 instances in ngram-map.h and ngram-map.cpp)

Changed files:
filename: common/ngram-map.cpp
patch: @@ -461,7 +461,7 @@ void common_ngram_map_draft(common_ngram_map & map,
             slot_max = v;
         }
     }
-    // What is sum of the other occurences?
+    // What is sum of the other occurrences?
     uint32_t sum_occur = 0;
     for (int v = 0; v < COMMON_NGRAM_MAX_VALUES; ++v) {
         if (v == slot_max) {

filename: common/ngram-map.h
patch: @@ -44,7 +44,7 @@ llama_tokens common_ngram_simple_draft(
 // statistics of a m-gram after a known n-gram
 struct common_ngram_map_value {
     size_t   value_idx =  0;  // index of value m-gram in token-history (0 if unused)
-    uint16_t value_num =  0;  // number of occurences of this value m-gram after the key n-gram (0 in an unused values-slot)
+    uint16_t value_num =  0;  // number of occurrences of this value m-gram after the key n-gram (0 in an unused values-slot)
     int16_t n_accepted = -1;  // number of accepted tokens at last draft (-1 if unused)
 };
 
@@ -53,7 +53,7 @@ struct common_ngram_map_key {
     size_t   key_idx;   // index of key n-gram in token-history
     size_t   stat_idx;  // index of last token of stastistics computation (key_num, values)
 
-    uint16_t key_num;   // number of occurences of this key n-gram in token-history
+    uint16_t key_num;   // number of occurrences of this key n-gram in token-history
     common_ngram_map_value values[COMMON_NGRAM_MAX_VALUES]; // some known values after the key
 };
 

filename: include/llama.h
patch: @@ -482,7 +482,7 @@ extern "C" {
     enum llama_params_fit_status {
         LLAMA_PARAMS_FIT_STATUS_SUCCESS = 0, // found allocations that are projected to fit
         LLAMA_PARAMS_FIT_STATUS_FAILURE = 1, // could not find allocations that are projected to fit
-        LLAMA_PARAMS_FIT_STATUS_ERROR   = 2, // a hard error occured, e.g. because no model could be found at the specified path
+        LLAMA_PARAMS_FIT_STATUS_ERROR   = 2, // a hard error occurred, e.g. because no model could be found at the specified path
     };
 
     // fits mparams and cparams to free device memory (assumes system memory is unlimited)
Repository: vuejs/vue
Pull request: reusing onRE

<!--
Please make sure to read the Pull Request Guidelines:
https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

**What kind of change does this PR introduce?** (check at least one)

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update
- [x] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:

**Does this PR introduce a breaking change?** (check one)

- [ ] Yes
- [x] No

Changed files:
filename: src/compiler/error-detector.js
patch: @@ -1,6 +1,6 @@
 /* @flow */
 
-import { dirRE } from './parser/index'
+import { dirRE, onRE } from './parser/index'
 
 // operators like typeof, instanceof and in are allowed
 const prohibitedKeywordRE = new RegExp('\\b' + (
@@ -11,7 +11,6 @@ const prohibitedKeywordRE = new RegExp('\\b' + (
 const unaryOperatorsRE = new RegExp('\\b' + (
   'delete,typeof,void'
 ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)')
-const eventAttrRE = /^@|^v-on:/
 // check valid identifier for v-for
 const identRE = /[A-Za-z_$][\w$]*/
 // strip strings in expressions
@@ -34,7 +33,7 @@ function checkNode (node: ASTNode, errors: Array<string>) {
         if (value) {
           if (name === 'v-for') {
             checkFor(node, `v-for="${value}"`, errors)
-          } else if (eventAttrRE.test(name)) {
+          } else if (onRE.test(name)) {
             checkEvent(value, `${name}="${value}"`, errors)
           } else {
             checkExpression(value, `${name}="${value}"`, errors)

filename: src/compiler/parser/index.js
patch: @@ -18,10 +18,10 @@ import {
 } from '../helpers'
 
 export const dirRE = /^v-|^@|^:/
+export const onRE = /^@|^v-on:/
 export const forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/
 export const forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/
 const bindRE = /^:|^v-bind:/
-const onRE = /^@|^v-on:/
 const argRE = /:(.*)$/
 const modifierRE = /\.[^.]+/g
Repository: ollama/ollama
Pull request: CI: set platform build build_linux script to keep buildx happy

The runners don't have emulation set up so the default multi-platform build wont work.

Changed files:
filename: .github/workflows/release.yaml
patch: @@ -359,7 +359,7 @@ jobs:
     environment: release
     runs-on: linux
     env:
-      BUILD_ARCH: amd64
+      PLATFORM: linux/amd64
     steps:
       - uses: actions/checkout@v4
         with:
@@ -382,7 +382,7 @@ jobs:
     environment: release
     runs-on: linux-arm64
     env:
-      BUILD_ARCH: arm64
+      PLATFORM: linux/arm64
     steps:
       - uses: actions/checkout@v4
         with:
Repository: facebook/react
Pull request: [Fizz Node] Fix null bytes written at text chunk boundaries

We encode strings 2048 UTF-8 bytes at a time. If the string we are encoding crosses to the next chunk but the current chunk doesn't fit an integral number of characters, we need to make sure not to send the whole buffer, only the bytes that are actually meaningful.

Fixes #24985. I was able to verify that this fixes the repro shared in the issue (be careful when testing because the null bytes do not show when printed to my terminal, at least). However, I don't see a clear way to add a test for this that will be resilient to small changes in how we encode the markup (since it depends on where specific multibyte characters fall against the 2048-byte boundaries).

Changed files:
filename: packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
patch: @@ -635,4 +635,17 @@ describe('ReactDOMFizzServerNode', () => {
     expect(rendered).toBe(false);
     expect(isComplete).toBe(true);
   });
+
+  it('should encode multibyte characters correctly without nulls (#24985)', () => {
+    const {writable, output} = getTestWritable();
+    const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
+      <div>{Array(700).fill('ののの')}</div>,
+    );
+    pipe(writable);
+    jest.runAllTimers();
+    expect(output.result.indexOf('\u0000')).toBe(-1);
+    expect(output.result).toEqual(
+      '<div>' + Array(700).fill('ののの').join('<!-- -->') + '</div>',
+    );
+  });
 });

filename: packages/react-server/src/ReactServerStreamConfigNode.js
patch: @@ -75,12 +75,14 @@ function writeStringChunk(destination: Destination, stringChunk: string) {
   writtenBytes += written;
 
   if (read < stringChunk.length) {
-    writeToDestination(destination, (currentView: any));
+    writeToDestination(
+      destination,
+      (currentView: any).subarray(0, writtenBytes),
+    );
     currentView = new Uint8Array(VIEW_SIZE);
     writtenBytes = textEncoder.encodeInto(
       stringChunk.slice(read),
-      // $FlowFixMe[incompatible-call] found when upgrading Flow
-      currentView,
+      (currentView: any),
     ).written;
   }
Repository: ollama/ollama
Pull request: add Agents-Flex Libraries in README.md


Changed files:
filename: README.md
patch: @@ -393,6 +393,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
 - [Ollamaclient for Golang](https://github.com/xyproto/ollamaclient)
 - [High-level function abstraction in Go](https://gitlab.com/tozd/go/fun)
 - [Ollama PHP](https://github.com/ArdaGnsrn/ollama-php)
+- [Agents-Flex for Java](https://github.com/agents-flex/agents-flex) with [example](https://github.com/agents-flex/agents-flex/tree/main/agents-flex-llm/agents-flex-llm-ollama/src/test/java/com/agentsflex/llm/ollama)
 
 ### Mobile
Repository: electron/electron
Pull request: build: remove patch that landed in Chromium roll

#### Description of Change

<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
-->

#48752 and #48744 collided on `main` since the Chromium roll brought in that patch from upstream and it needs to be dropped on our end. Rectifying that here.

#### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [x] PR description included and stakeholders cc'd

#### Release Notes

Notes: none <!-- 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 -->


Changed files:
filename: patches/chromium/.patches
patch: @@ -143,5 +143,4 @@ expose_referrerscriptinfo_hostdefinedoptionsindex.patch
 chore_disable_protocol_handler_dcheck.patch
 fix_check_for_file_existence_before_setting_mtime.patch
 revert_cleanup_remove_feature_windelayspellcheckserviceinit.patch
-fix_release_mouse_buttons_on_focus_loss_on_wayland.patch
 fix_linux_tray_id.patch

filename: patches/chromium/fix_release_mouse_buttons_on_focus_loss_on_wayland.patch
patch: @@ -1,34 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Mitchell COhen <mitch.cohen@me.com>
-Date: Sun, 2 Nov 2025 15:30:56 -0500
-Subject: fix: release mouse buttons on focus loss on Wayland
-
-Fixes an issue where the mouse flags would get stuck if you right-click
-the CSD titlebar in Wayland.
-
-Bug: 455147429
-Change-Id: I9f5a9f395b3c1d85094a40a92d40691a897dbd05
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7091872
-Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
-Reviewed-by: Kramer Ge <fangzhoug@chromium.org>
-Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
-Cr-Commit-Position: refs/heads/main@{#1538048}
-
-diff --git a/ui/ozone/platform/wayland/host/wayland_event_source.cc b/ui/ozone/platform/wayland/host/wayland_event_source.cc
-index 4cc15e842b633e93f1d6654225765769eb75fffd..4e421ccbd36d4efebd43c9def5b575b7d8d5e336 100644
---- a/ui/ozone/platform/wayland/host/wayland_event_source.cc
-+++ b/ui/ozone/platform/wayland/host/wayland_event_source.cc
-@@ -336,6 +336,13 @@ void WaylandEventSource::OnPointerFocusChanged(
-     // Save new pointer location.
-     pointer_location_ = location;
-     window_manager_->SetPointerFocusedWindow(window);
-+  } else {
-+    // The compositor may swallow the release event for any buttons that are
-+    // pressed when the window loses focus, e.g. when right-clicking the
-+    // titlebar to open the system menu on GNOME.
-+    if (!connection_->IsDragInProgress()) {
-+      ReleasePressedPointerButtons(window, ui::EventTimeForNow());
-+    }
-   }
- 
-   auto closure = focused ? base::NullCallback()