fix bug - popup windows show hiding logic
Pull request / build (pull_request) Successful in 39s

This commit is contained in:
2026-08-12 18:12:08 +05:00
parent 6259dbd6b3
commit 87266e6c13
13 changed files with 503 additions and 442 deletions
-28
View File
@@ -38,38 +38,10 @@ public static class MessageLoop
/// <summary>Asks the loop on this thread to finish.</summary>
public static void Quit(int exitCode = 0) => PostQuitMessage(exitCode);
/// <summary>
/// Runs everything already waiting in the queue and returns.
/// </summary>
/// <remarks>
/// For the tests and for the rare place that has to let a posted message through
/// without giving up control for good.
/// </remarks>
public static void DrainQueue()
{
while (PeekMessage(out Message message, IntPtr.Zero, 0, 0, PM_REMOVE))
{
if (message.message == WM_QUIT)
{
PostQuitMessage((int)message.wParam);
return;
}
TranslateMessage(ref message);
DispatchMessage(ref message);
}
}
private const uint WM_QUIT = 0x0012;
private const uint PM_REMOVE = 0x0001;
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "GetMessageW")]
private static extern int GetMessage(out Message lpMsg, IntPtr hWnd, uint filterMin, uint filterMax);
[DllImport("user32.dll", CharSet = CharSet.Unicode, EntryPoint = "PeekMessageW")]
private static extern bool PeekMessage(
out Message lpMsg, IntPtr hWnd, uint filterMin, uint filterMax, uint removeMsg);
[DllImport("user32.dll")]
private static extern bool TranslateMessage(ref Message lpMsg);