aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail/x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/detail/x11.c')
-rw-r--r--pugl/detail/x11.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index a766ace..cb9f0e2 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -443,6 +443,15 @@ puglGrabFocus(PuglView* view)
view->impl->display, view->impl->win, RevertToNone, CurrentTime);
}
+bool
+puglHasFocus(const PuglView* view)
+{
+ int revertTo = 0;
+ Window focusedWindow = 0;
+ XGetInputFocus(view->impl->display, &focusedWindow, &revertTo);
+ return focusedWindow == view->impl->win;
+}
+
void
puglRequestAttention(PuglView* view)
{