diff options
author | David Robillard <d@drobilla.net> | 2019-07-23 01:07:37 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-07-23 20:28:56 +0200 |
commit | eb64f8a3228184a67e61ab209f5c9f64cf9c120a (patch) | |
tree | 694c4337dd6d1d820fae9d347133b1a244e73dab | |
parent | bea2f16b9beee574a5e19d73d63cbbbaa7078b0e (diff) |
Windows: Only kill timer when actually flashing
-rw-r--r-- | pugl/pugl_win.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index acf1700..b5afe90 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -79,6 +79,7 @@ struct PuglInternalsImpl { HGLRC hglrc; DWORD refreshRate; double timerFrequency; + bool flashing; bool resizing; bool mouseTracked; }; @@ -653,8 +654,10 @@ handleCrossing(PuglView* view, const PuglEventType type, POINT pos) static void stopFlashing(PuglView* view) { - KillTimer(view->impl->hwnd, PUGL_URGENT_TIMER_ID); - FlashWindow(view->impl->hwnd, FALSE); + if (view->impl->flashing) { + KillTimer(view->impl->hwnd, PUGL_URGENT_TIMER_ID); + FlashWindow(view->impl->hwnd, FALSE); + } } static LRESULT @@ -838,6 +841,7 @@ puglRequestAttention(PuglView* view) if (!view->impl->mouseTracked || GetFocus() != view->impl->hwnd) { FlashWindow(view->impl->hwnd, TRUE); SetTimer(view->impl->hwnd, PUGL_URGENT_TIMER_ID, 500, NULL); + view->impl->flashing = true; } } |