From 14b35ef217f5ee387c4f33b1b24bebb015e18f23 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Jan 2023 19:27:18 -0500 Subject: Replace map/unmap events with more expressive configure events --- src/win.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/win.c') diff --git a/src/win.c b/src/win.c index b410607..a0b7901 100644 --- a/src/win.c +++ b/src/win.c @@ -576,7 +576,8 @@ handleConfigure(PuglView* view, PuglEvent* event) event->configure.height = (PuglSpan)height; event->configure.style = - ((view->resizing ? PUGL_VIEW_STYLE_RESIZING : 0U) | + ((view->impl->mapped ? PUGL_VIEW_STYLE_MAPPED : 0U) | + (view->resizing ? PUGL_VIEW_STYLE_RESIZING : 0U) | (view->impl->fullscreen ? PUGL_VIEW_STYLE_FULLSCREEN : 0U) | (view->impl->minimized ? PUGL_VIEW_STYLE_HIDDEN : 0U) | (view->impl->maximized ? (PUGL_VIEW_STYLE_TALL | PUGL_VIEW_STYLE_WIDE) @@ -674,17 +675,14 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_SHOWWINDOW: if (wParam) { - handleConfigure(view, &event); - puglDispatchEvent(view, &event); - event.type = PUGL_NOTHING; - RedrawWindow(view->impl->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_INTERNALPAINT); } - event.any.type = wParam ? PUGL_MAP : PUGL_UNMAP; + view->impl->mapped = wParam; + handleConfigure(view, &event); break; case WM_DISPLAYCHANGE: view->impl->scaleFactor = puglWinGetViewScaleFactor(view); -- cgit v1.2.1