fix(windows): undecorated resize direction for top left and right border (#1070)

* Fix undecorated resize top left and right border

* Add change file
This commit is contained in:
Tony
2025-02-25 09:51:55 +08:00
committed by GitHub
parent 849abaf0b1
commit f4ec11d795
2 changed files with 12 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"tao": patch
---
Fix undecorated top left and right border resizing direction on Windows

View File

@@ -2190,20 +2190,21 @@ unsafe fn public_window_callback_inner<T: 'static>(
// if we have undecorated shadows, we only need to handle the top edge
if window_flags.contains(WindowFlags::MARKER_UNDECORATED_SHADOW) {
let rect = util::client_rect(window);
let mut cursor_pt = POINT { x: cx, y: cy };
if ScreenToClient(window, &mut cursor_pt).as_bool()
&& cursor_pt.y >= 0
&& cursor_pt.y <= border_y
&& cursor_pt.x >= 0
&& cursor_pt.x <= rect.right
{
result = ProcResult::Value(LRESULT(HTTOP as _));
}
} else {
//otherwise do full hit testing
}
// otherwise do full hit testing
else {
let border_x = GetSystemMetricsForDpi(SM_CXFRAME, dpi);
let mut rect = RECT::default();
let _ = GetWindowRect(window, &mut rect);
let rect = util::window_rect(window);
let hit_result = crate::window::hit_test(
(rect.left, rect.top, rect.right, rect.bottom),
cx,