mirror of
https://github.com/tauri-apps/tao.git
synced 2026-01-31 00:35:16 +01:00
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:
5
.changes/undecorated-resize-top-left-right.md
Normal file
5
.changes/undecorated-resize-top-left-right.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tao": patch
|
||||
---
|
||||
|
||||
Fix undecorated top left and right border resizing direction on Windows
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user