Skip to content

Commit c62b4a0

Browse files
committed
perf: return HTCLIENT directly when window is fullscreen or maximized
Signed-off-by: leo <[email protected]>
1 parent af9cf6b commit c62b4a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Native/Windows.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public void SetupWindow(Window window)
112112
// Custom WM_NCHITTEST
113113
if (msg == 0x0084)
114114
{
115+
handled = true;
116+
117+
if (window.WindowState == WindowState.FullScreen || window.WindowState == WindowState.Maximized)
118+
return (IntPtr)HitTest.HTCLIENT;
119+
115120
var p = IntPtrToPixelPoint(lParam);
116121
GetWindowRect(hWnd, out var rcWindow);
117122

@@ -135,7 +140,6 @@ public void SetupWindow(Window window)
135140
HitTest.HTBOTTOMLEFT, HitTest.HTBOTTOM, HitTest.HTBOTTOMRIGHT
136141
};
137142

138-
handled = true;
139143
return (IntPtr)(zones[row * 3 + col]);
140144
}
141145

0 commit comments

Comments
 (0)