From 2f5e2303380d084ab9b097765d34f98504324d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 11 May 2017 18:29:08 +0200 Subject: [PATCH] Add attention request to joystick test --- tests/joysticks.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/joysticks.c b/tests/joysticks.c index a51062db..263bcb1c 100644 --- a/tests/joysticks.c +++ b/tests/joysticks.c @@ -52,6 +52,7 @@ #define strdup(x) _strdup(x) #endif +static GLFWwindow* window; static int joysticks[GLFW_JOYSTICK_LAST + 1]; static int joystick_count = 0; @@ -79,6 +80,9 @@ static void joystick_callback(int jid, int event) joystick_count--; } + + if (!glfwGetWindowAttrib(window, GLFW_FOCUSED)) + glfwRequestWindowAttention(window); } static const char* joystick_label(int jid) @@ -91,7 +95,6 @@ static const char* joystick_label(int jid) int main(void) { int jid, hat_buttons = GLFW_FALSE; - GLFWwindow* window; struct nk_context* nk; struct nk_font_atlas* atlas;