diff --git a/pupil_src/launchables/eye.py b/pupil_src/launchables/eye.py index 2bb94f8985..2ebfffa3f0 100644 --- a/pupil_src/launchables/eye.py +++ b/pupil_src/launchables/eye.py @@ -236,9 +236,10 @@ def consume_events_and_render_buffer(): glfw.glfwMakeContextCurrent(main_window) clear_gl_screen() - glViewport(0, 0, *g_pool.camera_render_size) - for p in g_pool.plugins: - p.gl_display() + if all(c > 0 for c in g_pool.camera_render_size): + glViewport(0, 0, *g_pool.camera_render_size) + for p in g_pool.plugins: + p.gl_display() glViewport(0, 0, *window_size) # render graphs @@ -289,6 +290,11 @@ def on_resize(window, w, h): nonlocal window_size nonlocal content_scale + is_minimized = bool(glfw.glfwGetWindowAttrib(window, glfw.GLFW_ICONIFIED)) + + if is_minimized: + return + # Always clear buffers on resize to make sure that there are no overlapping # artifacts from previous frames. gl_utils.glClear(gl_utils.GL_COLOR_BUFFER_BIT)