mac: Fix accelerators in overlay BrowserView (see #3188)

CefWindowImpl::CanHandleAccelerators was returning false for
accelerators triggered in the overlay BrowserView due to
IsWindowKey (called from NativeWidgetMac::IsActive) returning
false. View::CanHandleAccelerators, on the other hand, only
checks IsActive for Aura (non-MacOS) windows. We therefore
delegate to the View implementation for consistent handling.
This commit is contained in:
Marshall Greenblatt 2024-11-04 14:17:30 -05:00
parent 0860ec2f3d
commit 41fbe6f0c2
1 changed files with 2 additions and 2 deletions

View File

@ -500,8 +500,8 @@ bool CefWindowImpl::AcceleratorPressed(const ui::Accelerator& accelerator) {
} }
bool CefWindowImpl::CanHandleAccelerators() const { bool CefWindowImpl::CanHandleAccelerators() const {
if (delegate() && widget_) { if (delegate() && widget_ && root_view()) {
return widget_->IsActive(); return root_view()->CanHandleAccelerators();
} }
return false; return false;
} }