aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_win.c8
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;
}
}