diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 1cd84655ad..4eef93ee89 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -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 diff --git a/patches/chromium/fix_release_mouse_buttons_on_focus_loss_on_wayland.patch b/patches/chromium/fix_release_mouse_buttons_on_focus_loss_on_wayland.patch new file mode 100644 index 0000000000..aab439b5c0 --- /dev/null +++ b/patches/chromium/fix_release_mouse_buttons_on_focus_loss_on_wayland.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mitchell COhen +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 +Reviewed-by: Kramer Ge +Commit-Queue: Thomas Anderson +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()