fix: resizing borders in nondraggable regions (#37016)
* fix: resizing borders in nondraggable regions * chore: remove frame handling from ShouldDescendIntoChildForEventHandling
This commit is contained in:
parent
1486cbdf64
commit
0026fdb78a
2 changed files with 16 additions and 13 deletions
|
@ -24,6 +24,10 @@
|
|||
#include "ui/base/hit_test.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
#include "shell/browser/ui/views/frameless_view.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "ui/base/win/shell.h"
|
||||
#include "ui/display/win/screen_win.h"
|
||||
|
@ -693,6 +697,17 @@ void NativeWindow::NotifyWindowMessage(UINT message,
|
|||
#endif
|
||||
|
||||
int NativeWindow::NonClientHitTest(const gfx::Point& point) {
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
// We need to ensure we account for resizing borders on Windows and Linux.
|
||||
if ((!has_frame() || has_client_frame()) && IsResizable()) {
|
||||
auto* frame =
|
||||
static_cast<FramelessView*>(widget()->non_client_view()->frame_view());
|
||||
int border_hit = frame->ResizingBorderHitTest(point);
|
||||
if (border_hit != HTNOWHERE)
|
||||
return border_hit;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (auto* provider : draggable_region_providers_) {
|
||||
int hit = provider->NonClientHitTest(point);
|
||||
if (hit != HTNOWHERE)
|
||||
|
|
|
@ -1592,19 +1592,7 @@ views::View* NativeWindowViews::GetContentsView() {
|
|||
bool NativeWindowViews::ShouldDescendIntoChildForEventHandling(
|
||||
gfx::NativeView child,
|
||||
const gfx::Point& location) {
|
||||
// App window should claim mouse events that fall within any BrowserViews'
|
||||
// draggable region.
|
||||
if (NonClientHitTest(location) != HTNOWHERE)
|
||||
return false;
|
||||
|
||||
// And the events on border for dragging resizable frameless window.
|
||||
if ((!has_frame() || has_client_frame()) && resizable_) {
|
||||
auto* frame =
|
||||
static_cast<FramelessView*>(widget()->non_client_view()->frame_view());
|
||||
return frame->ResizingBorderHitTest(location) == HTNOWHERE;
|
||||
}
|
||||
|
||||
return true;
|
||||
return NonClientHitTest(location) == HTNOWHERE;
|
||||
}
|
||||
|
||||
views::ClientView* NativeWindowViews::CreateClientView(views::Widget* widget) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue