From c62b4a031f9a969cbe8647525504f69efe3eeb69 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 12 May 2025 18:09:25 +0800 Subject: [PATCH] perf: return `HTCLIENT` directly when window is fullscreen or maximized Signed-off-by: leo --- src/Native/Windows.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index c6459656..15201d1f 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -112,6 +112,11 @@ namespace SourceGit.Native // Custom WM_NCHITTEST if (msg == 0x0084) { + handled = true; + + if (window.WindowState == WindowState.FullScreen || window.WindowState == WindowState.Maximized) + return (IntPtr)HitTest.HTCLIENT; + var p = IntPtrToPixelPoint(lParam); GetWindowRect(hWnd, out var rcWindow); @@ -135,7 +140,6 @@ namespace SourceGit.Native HitTest.HTBOTTOMLEFT, HitTest.HTBOTTOM, HitTest.HTBOTTOMRIGHT }; - handled = true; return (IntPtr)(zones[row * 3 + col]); }