aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/win.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-07-24 23:46:17 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:32:16 +0200
commit5081d49f9f08596c07a8ed32430a4fa3e1baf352 (patch)
tree1e654d4fc34ea582e356373ae5bd39fac91ae3bc /pugl/detail/win.c
parentda0f76d22df1813a386f2b5e35ebe637da78889f (diff)
downloadpugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.tar.gz
pugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.tar.bz2
pugl-5081d49f9f08596c07a8ed32430a4fa3e1baf352.zip
Add puglHasFocus()
Diffstat (limited to 'pugl/detail/win.c')
-rw-r--r--pugl/detail/win.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pugl/detail/win.c b/pugl/detail/win.c
index 42b9427..a4597b5 100644
--- a/pugl/detail/win.c
+++ b/pugl/detail/win.c
@@ -631,10 +631,16 @@ puglGrabFocus(PuglView* view)
SetFocus(view->impl->hwnd);
}
+bool
+puglHasFocus(const PuglView* view)
+{
+ return GetFocus() == view->impl->hwnd;
+}
+
void
puglRequestAttention(PuglView* view)
{
- if (!view->impl->mouseTracked || GetFocus() != view->impl->hwnd) {
+ if (!view->impl->mouseTracked || !puglHasFocus(view)) {
FlashWindow(view->impl->hwnd, TRUE);
SetTimer(view->impl->hwnd, PUGL_URGENT_TIMER_ID, 500, NULL);
view->impl->flashing = true;