fix: draggable views on BrowserViews on Windows (#26738)

This commit is contained in:
Shelley Vohr 2020-12-01 15:03:00 -08:00 committed by GitHub
parent cdcee04bbe
commit 528b0f0e74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 0 deletions

View file

@ -4,6 +4,7 @@
#include "shell/browser/ui/views/frameless_view.h"
#include "shell/browser/native_browser_view_views.h"
#include "shell/browser/native_window_views.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
@ -68,6 +69,15 @@ int FramelessView::NonClientHitTest(const gfx::Point& cursor) {
if (frame_->IsFullscreen())
return HTCLIENT;
// Check attached BrowserViews for potential draggable areas.
for (auto* view : window_->browser_views()) {
auto* native_view = static_cast<NativeBrowserViewViews*>(view);
auto* view_draggable_region = native_view->draggable_region();
if (view_draggable_region &&
view_draggable_region->contains(cursor.x(), cursor.y()))
return HTCAPTION;
}
// Check for possible draggable region in the client area for the frameless
// window.
SkRegion* draggable_region = window_->draggable_region();