From 0098160f2aed15ffc015f7daae0287302631e3c1 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 29 Aug 2025 13:15:17 -0400 Subject: [PATCH] fix: ensure dragging works again after emitting contextmenu event (#48224) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/native_window_views_win.cc | 5 ----- .../browser/ui/win/electron_desktop_window_tree_host_win.cc | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/shell/browser/native_window_views_win.cc b/shell/browser/native_window_views_win.cc index f4c8c11949..2a7f74f013 100644 --- a/shell/browser/native_window_views_win.cc +++ b/shell/browser/native_window_views_win.cc @@ -324,11 +324,6 @@ bool NativeWindowViews::PreHandleMSG(UINT message, return false; } - case WM_RBUTTONUP: { - if (!has_frame()) - electron::api::WebContents::SetDisableDraggableRegions(false); - return false; - } case WM_GETMINMAXINFO: { WINDOWPLACEMENT wp; wp.length = sizeof(WINDOWPLACEMENT); diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc index 40a3d6b66d..42039cd92f 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc @@ -142,6 +142,7 @@ bool ElectronDesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { if (prevent_default) { electron::api::WebContents::SetDisableDraggableRegions(true); views::DesktopWindowTreeHostWin::HandleMouseEvent(event); + electron::api::WebContents::SetDisableDraggableRegions(false); } return prevent_default; }