mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: cherry-pick 7dd3b1c86795 from chromium (#28818)
* chore: cherry-pick 7dd3b1c86795 from chromium * update patches Co-authored-by: Electron Bot <electron@github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -113,5 +113,6 @@ word_break_between_space_and_alphanumeric.patch
|
||||
moves_background_color_setter_of_webview_to_blinks_webprefs_logic.patch
|
||||
blink_wasm_eval_csp.patch
|
||||
cherry-pick-162efe98330e.patch
|
||||
cherry-pick-7dd3b1c86795.patch
|
||||
cherry-pick-1536a564d959.patch
|
||||
cherry-pick-e4abe032f3ad.patch
|
||||
|
||||
40
patches/chromium/cherry-pick-7dd3b1c86795.patch
Normal file
40
patches/chromium/cherry-pick-7dd3b1c86795.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Wez <wez@chromium.org>
|
||||
Date: Thu, 15 Apr 2021 18:24:27 +0000
|
||||
Subject: Handle window deletion during HandleDisplayChange.
|
||||
|
||||
In principle there is no reason why the HWNDMessageHandler shouldn't be
|
||||
deleted by a HandleDisplayChange() call out to the delegate, e.g. if the
|
||||
change results in a change in window layout.
|
||||
|
||||
(cherry picked from commit 299155e5e37a77670b7969771e09e9a16b1f5612)
|
||||
|
||||
Bug: 1192552
|
||||
Change-Id: I9fca35ff32e7037c6492f4cee7069e272059b920
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2804382
|
||||
Auto-Submit: Wez <wez@chromium.org>
|
||||
Commit-Queue: Scott Violet <sky@chromium.org>
|
||||
Reviewed-by: Scott Violet <sky@chromium.org>
|
||||
Cr-Original-Commit-Position: refs/heads/master@{#869603}
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826321
|
||||
Cr-Commit-Position: refs/branch-heads/4430@{#1291}
|
||||
Cr-Branched-From: e5ce7dc4f7518237b3d9bb93cccca35d25216cbe-refs/heads/master@{#857950}
|
||||
|
||||
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
|
||||
index a23108d0a38af3388b35bd5a0ae3cc3d5e565d93..1332f9ef132b7e5f099cd44f8a4b4831e10dd497 100644
|
||||
--- a/ui/views/win/hwnd_message_handler.cc
|
||||
+++ b/ui/views/win/hwnd_message_handler.cc
|
||||
@@ -1677,7 +1677,13 @@ void HWNDMessageHandler::OnDisplayChange(UINT bits_per_pixel,
|
||||
const gfx::Size& screen_size) {
|
||||
TRACE_EVENT0("ui", "HWNDMessageHandler::OnDisplayChange");
|
||||
|
||||
+ base::WeakPtr<HWNDMessageHandler> ref(msg_handler_weak_factory_.GetWeakPtr());
|
||||
delegate_->HandleDisplayChange();
|
||||
+
|
||||
+ // HandleDisplayChange() may result in |this| being deleted.
|
||||
+ if (!ref)
|
||||
+ return;
|
||||
+
|
||||
// Force a WM_NCCALCSIZE to occur to ensure that we handle auto hide
|
||||
// taskbars correctly.
|
||||
SendFrameChanged();
|
||||
Reference in New Issue
Block a user