W over A win32 window functions; wakeup on WM_CLOSE (manual merge of

cbf3fd5587)
This commit is contained in:
Ryan Fleury
2026-06-10 04:43:01 -07:00
parent 19cb0331b0
commit 9af4c3d614
@@ -375,6 +375,7 @@ w32_wm_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_CLOSE:
{
w32_wm_push_event(WM_EventKind_WindowClose, window);
wm_send_wakeup_event();
}break;
case WM_LBUTTONUP:
@@ -1499,7 +1500,7 @@ wm_dpi_from_monitor(WM_Monitor monitor)
internal void
wm_send_wakeup_event(void)
{
PostThreadMessageA(w32_wm_state->gfx_thread_tid, 0x401, 0, 0);
PostThreadMessageW(w32_wm_state->gfx_thread_tid, 0x401, 0, 0);
}
internal WM_EventList
@@ -1508,13 +1509,13 @@ wm_get_events(Arena *arena, B32 wait)
w32_wm_event_arena = arena;
MemoryZeroStruct(&w32_wm_event_list);
MSG msg = {0};
if(!wait || GetMessage(&msg, 0, 0, 0))
if(!wait || GetMessageW(&msg, 0, 0, 0))
{
B32 first_wait = wait;
for(;first_wait || PeekMessage(&msg, 0, 0, 0, PM_REMOVE); first_wait = 0)
for(;first_wait || PeekMessageW(&msg, 0, 0, 0, PM_REMOVE); first_wait = 0)
{
DispatchMessage(&msg);
TranslateMessage(&msg);
DispatchMessageW(&msg);
if(msg.message == WM_QUIT)
{
w32_wm_push_event(WM_EventKind_WindowClose, 0);
@@ -1605,7 +1606,7 @@ hcursor = curs; }break;
{
if(hcursor != w32_wm_state->hCursor)
{
PostMessage(0, WM_SETCURSOR, 0, 0);
PostMessageW(0, WM_SETCURSOR, 0, 0);
POINT p = {0};
GetCursorPos(&p);
SetCursorPos(p.x, p.y);