refactor: better solution for resizable frameless DCHECK (#33790)

* refactor: better solution for resizable frameless DCHECK

* fix: also implement TargetForRectin WinFrameView
This commit is contained in:
Shelley Vohr 2022-04-29 02:34:12 +02:00 committed by GitHub
parent 192a7fad0d
commit fb534c927a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 9 deletions

View file

@ -112,6 +112,16 @@ void FramelessView::UpdateWindowTitle() {}
void FramelessView::SizeConstraintsChanged() {}
views::View* FramelessView::TargetForRect(views::View* root,
const gfx::Rect& rect) {
CHECK_EQ(root, this);
if (NonClientHitTest(rect.origin()) != HTCLIENT)
return this;
return NonClientFrameView::TargetForRect(root, rect);
}
gfx::Size FramelessView::CalculatePreferredSize() const {
return frame_->non_client_view()
->GetWindowBoundsForClientBounds(