Skip to content

Commit

Permalink
glfw backend: wait when window is out of focus
Browse files Browse the repository at this point in the history
  • Loading branch information
luteberget committed Oct 4, 2019
1 parent 1af633e commit 143cca6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/backend_glfw/lib/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ void glfw_opengl3_HandleEvents(bool* close = nullptr) {
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
//

int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
if (focused == 0) {
glfwWaitEvents();
}

glfwPollEvents();

}
Expand Down

0 comments on commit 143cca6

Please sign in to comment.