aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-23 01:07:37 +0200
committerDavid Robillard <d@drobilla.net>2019-07-23 20:28:56 +0200
commiteb64f8a3228184a67e61ab209f5c9f64cf9c120a (patch)
tree694c4337dd6d1d820fae9d347133b1a244e73dab /pugl
parentbea2f16b9beee574a5e19d73d63cbbbaa7078b0e (diff)
downloadpugl-eb64f8a3228184a67e61ab209f5c9f64cf9c120a.tar.gz
pugl-eb64f8a3228184a67e61ab209f5c9f64cf9c120a.tar.bz2
pugl-eb64f8a3228184a67e61ab209f5c9f64cf9c120a.zip
Windows: Only kill timer when actually flashing
Diffstat (limited to 'pugl')
-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;
}
}