From 9540dba1682eaea1f1c1acf652ed745ade15b269 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Fri, 11 Mar 2022 22:49:51 +0530 Subject: [PATCH 1/2] chore: cherry-pick 2ed58f4 from chromium (#33109) Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658 Fixes: https://github.com/electron/electron/issues/33049 Signed-off-by: Darshan Sen Co-authored-by: Charles Kerr --- patches/chromium/.patches | 8 ++++ ...e_incorrect_width_height_adjustments.patch | 39 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 patches/chromium/remove_incorrect_width_height_adjustments.patch diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 1c507560e76bc..253ddf547959b 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -153,3 +153,11 @@ cherry-pick-1277917.patch cherry-pick-62142d222a80.patch cherry-pick-1887414c016d.patch cherry-pick-6b2643846ae3.patch +fix_dont_delete_SerialPortManager_on_main_thread.patch +feat_add_data_transfer_to_requestsingleinstancelock.patch +fix_crash_when_saving_edited_pdf_files.patch +port_autofill_colors_to_the_color_pipeline.patch +build_disable_partition_alloc_on_mac.patch +build_disable_thin_lto_on_mac.patch +fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch +remove_incorrect_width_height_adjustments.patch diff --git a/patches/chromium/remove_incorrect_width_height_adjustments.patch b/patches/chromium/remove_incorrect_width_height_adjustments.patch new file mode 100644 index 0000000000000..4fce52ba6e282 --- /dev/null +++ b/patches/chromium/remove_incorrect_width_height_adjustments.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bruce Dawson +Date: Mon, 28 Feb 2022 19:07:41 +0000 +Subject: Remove incorrect width/height adjustments + +In late 2016 a change which fixed some problems around window sizing +when attaching or detaching additional displays was landed, which fixed +some genuine bugs. Unfortunately it included a subtraction of 1 from the +width and height of the Chrome window. I couldn't find any discussion of +this size adjustment and I think that it was just a misunderstanding of +how window rectangles work (inclusive versus exclusive extents). + +This size adjustment causes non-maximized Chrome windows to shrink every +time a monitor is added or removed. The problematic commit was found +by the bug-filer through a bisect of more than four years of Chrome +history - I'm just landing the fix that they suggested. + +Bug: 1300415 +Change-Id: Ief124f584a91aa9cc3f10704b0cc1e83356dea5b +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3492658 +Reviewed-by: Allen Bauer +Commit-Queue: Bruce Dawson +Cr-Commit-Position: refs/heads/main@{#975872} + +diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc +index 264a9109e42c23e9be6bf7269b3cfee2634b61e4..86f06d2a2c9588a2210a9f78f47e73f1b7c5e329 100644 +--- a/ui/views/win/hwnd_message_handler.cc ++++ b/ui/views/win/hwnd_message_handler.cc +@@ -2834,8 +2834,8 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) { + // (Win+Shift+Arrows). See crbug.com/656001. + window_rect.left = window_pos->x; + window_rect.top = window_pos->y; +- window_rect.right = window_pos->x + window_pos->cx - 1; +- window_rect.bottom = window_pos->y + window_pos->cy - 1; ++ window_rect.right = window_pos->x + window_pos->cx; ++ window_rect.bottom = window_pos->y + window_pos->cy; + } + + HMONITOR monitor; From ef8ce84b1f4a31109c181f46887aba0b2442ee9a Mon Sep 17 00:00:00 2001 From: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 02:20:16 +0000 Subject: [PATCH 2/2] chore: update patches --- .../chromium/remove_incorrect_width_height_adjustments.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/chromium/remove_incorrect_width_height_adjustments.patch b/patches/chromium/remove_incorrect_width_height_adjustments.patch index 4fce52ba6e282..fde557a9151ab 100644 --- a/patches/chromium/remove_incorrect_width_height_adjustments.patch +++ b/patches/chromium/remove_incorrect_width_height_adjustments.patch @@ -23,10 +23,10 @@ Commit-Queue: Bruce Dawson Cr-Commit-Position: refs/heads/main@{#975872} diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 264a9109e42c23e9be6bf7269b3cfee2634b61e4..86f06d2a2c9588a2210a9f78f47e73f1b7c5e329 100644 +index e4c25788cf40e2b748cb25f004e448c0ea5f622c..72a62447a4a713c78984065f36f1734ad0826b62 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -2834,8 +2834,8 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) { +@@ -2818,8 +2818,8 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) { // (Win+Shift+Arrows). See crbug.com/656001. window_rect.left = window_pos->x; window_rect.top = window_pos->y;