mirror of
https://github.com/imputnet/helium.git
synced 2026-10-19 01:39:56 -05:00
helium/ui: guard macOS hit tests during window teardown (#2138)
hopefully fixes #2129
This commit is contained in:
5 files changed
+26
-13
No files matched your search
@@ -58,7 +58,7 @@
|
||||
}
|
||||
|
||||
void BrowserView::OnWidgetBoundsChanged(views::Widget* widget,
|
||||
@@ -5545,7 +5568,20 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5551,7 +5574,20 @@ void BrowserView::LoadAccelerators() {
|
||||
browser_->GetProfile()->IsOffTheRecord() &&
|
||||
browser_->GetProfile()->GetOTRProfileID().IsCaptivePortal();
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@
|
||||
for (const auto& entry : accelerator_list) {
|
||||
// In app mode, only allow accelerators of allowlisted commands to pass
|
||||
// through.
|
||||
@@ -5572,11 +5608,13 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5578,11 +5614,13 @@ void BrowserView::LoadAccelerators() {
|
||||
#endif
|
||||
|
||||
ui::Accelerator accelerator(entry.keycode, entry.modifiers);
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
// Register the Esc accelerators (both press and release) to ensure they are
|
||||
@@ -5596,6 +5634,33 @@ void BrowserView::LoadAccelerators() {
|
||||
@@ -5602,6 +5640,33 @@ void BrowserView::LoadAccelerators() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
|
||||
// Reparent PWA views that were moved for immersive and ChromeOS tablet
|
||||
// mode.
|
||||
@@ -4983,6 +5015,16 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -4989,6 +5021,16 @@ void BrowserView::AddedToWidget() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1126,7 +1126,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5088,9 +5085,6 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5094,9 +5091,6 @@ void BrowserView::AddedToWidget() {
|
||||
layout_views.horizontal_tab_strip_region_view =
|
||||
horizontal_tab_strip_region_view_;
|
||||
layout_views.vertical_tab_strip_region_view = vertical_tab_strip_region_view_;
|
||||
|
||||
@@ -641,7 +641,7 @@
|
||||
browser_->GetFeatures()
|
||||
.extension_keybinding_registry()
|
||||
->OnHostActivationChanged(active);
|
||||
@@ -5020,6 +5541,8 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5026,6 +5547,8 @@ void BrowserView::AddedToWidget() {
|
||||
base::BindRepeating(&BrowserView::OnToolbarTabStripStateChanged,
|
||||
base::Unretained(this)));
|
||||
OnToolbarTabStripStateChanged(helium_layout_controller);
|
||||
@@ -650,7 +650,7 @@
|
||||
}
|
||||
|
||||
UpdateTabSearchBubbleHost();
|
||||
@@ -5104,6 +5627,9 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5110,6 +5633,9 @@ void BrowserView::AddedToWidget() {
|
||||
// once per browser instance.
|
||||
auto* toolbar_button_provider = ToolbarButtonProvider::From(browser_);
|
||||
CHECK(toolbar_button_provider);
|
||||
@@ -660,7 +660,7 @@
|
||||
|
||||
// `AutofillBubbleHandlerImpl` depends on the ToolbarButtonProvider so it must
|
||||
// be constructed following the check above.
|
||||
@@ -5148,6 +5674,7 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5154,6 +5680,7 @@ void BrowserView::AddedToWidget() {
|
||||
tabs::VerticalTabStripStateController::From(browser_)) {
|
||||
if (vertical_tab_strip_state_controller->ShouldDisplayVerticalTabs()) {
|
||||
vertical_tab_strip_region_view_->InitializeTabStrip();
|
||||
@@ -668,7 +668,7 @@
|
||||
} else {
|
||||
horizontal_tab_strip_region_view_->InitializeTabStrip();
|
||||
}
|
||||
@@ -5160,6 +5687,8 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5166,6 +5693,8 @@ void BrowserView::AddedToWidget() {
|
||||
}
|
||||
|
||||
void BrowserView::RemovedFromWidget() {
|
||||
@@ -677,7 +677,7 @@
|
||||
CHECK(GetFocusManager());
|
||||
focus_manager_observation_.Reset();
|
||||
}
|
||||
@@ -5188,6 +5717,14 @@ void BrowserView::OnThemeChanged() {
|
||||
@@ -5194,6 +5723,14 @@ void BrowserView::OnThemeChanged() {
|
||||
}
|
||||
|
||||
FrameColorsChanged();
|
||||
@@ -692,7 +692,7 @@
|
||||
}
|
||||
|
||||
bool BrowserView::GetDropFormats(
|
||||
@@ -5451,6 +5988,9 @@ void BrowserView::UpdateFastResizeForCon
|
||||
@@ -5457,6 +5994,9 @@ void BrowserView::UpdateFastResizeForCon
|
||||
}
|
||||
|
||||
int BrowserView::GetClientAreaTop() {
|
||||
@@ -702,7 +702,7 @@
|
||||
views::View* top_view = toolbar_;
|
||||
|
||||
// Get the top of the top view in browser view coordinates.
|
||||
@@ -6062,6 +6602,56 @@ void BrowserView::OnWillChangeFocus(View
|
||||
@@ -6068,6 +6608,56 @@ void BrowserView::OnWillChangeFocus(View
|
||||
}
|
||||
void BrowserView::OnDidChangeFocus(View* focused_before, View* focused_now) {
|
||||
UpdateAccessibleNameForRootView();
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -4662,6 +4662,18 @@ int BrowserView::NonClientHitTest(const
|
||||
@@ -4603,6 +4603,12 @@ views::CloseRequestResult BrowserView::O
|
||||
|
||||
int BrowserView::NonClientHitTest(const gfx::Point& point) {
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
+ // AppKit can re-enter hit testing while the browser widget is being torn
|
||||
+ // down, after this view has been detached from its widget.
|
||||
+ if (!GetWidget()) {
|
||||
+ return HTNOWHERE;
|
||||
+ }
|
||||
+
|
||||
// The top container while in immersive fullscreen on macOS lives in another
|
||||
// Widget (OverlayWidgetMac). This means that BrowserView does not need to
|
||||
// consult BrowserViewLayout::NonClientHitTest() to calculate the hit test.
|
||||
@@ -4662,6 +4668,18 @@ int BrowserView::NonClientHitTest(const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user