diff options
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r-- | pugl/detail/win.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c index b7f03a3..2e0cd96 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -193,6 +193,9 @@ puglCreateWindow(PuglView* view, const char* title) puglSetFrame(view, view->frame); SetWindowLongPtr(impl->hwnd, GWLP_USERDATA, (LONG_PTR)view); + const PuglEvent createEvent = {{PUGL_CREATE, 0}}; + view->eventFunc(view, &createEvent); + return PUGL_SUCCESS; } @@ -203,7 +206,6 @@ puglShowWindow(PuglView* view) ShowWindow(impl->hwnd, SW_SHOWNORMAL); SetFocus(impl->hwnd); - view->visible = true; return PUGL_SUCCESS; } @@ -213,7 +215,6 @@ puglHideWindow(PuglView* view) PuglInternals* impl = view->impl; ShowWindow(impl->hwnd, SW_HIDE); - view->visible = false; return PUGL_SUCCESS; } @@ -554,9 +555,17 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) 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); } + + if ((bool)wParam != view->visible) { + view->visible = wParam; + event.any.type = wParam ? PUGL_MAP : PUGL_UNMAP; + } break; case WM_SIZE: handleConfigure(view, &event); |