Skip to content

Commit 92a7fc6

Browse files
committed
VulkanWindow: don't generate a constant flood of 0x0 resize events when minimized on Win32. See #893.
1 parent 3a3347a commit 92a7fc6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ngscopeclient/VulkanWindow.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,21 @@ void VulkanWindow::Render()
471471
int fbHeight = 0;
472472
glfwGetFramebufferSize(m_window, &fbWidth, &fbHeight);
473473
if( (fbWidth != m_width) || (fbHeight != m_height) )
474+
{
474475
m_resizeEventPending = true;
475476

477+
//Windows: this can fail and return 0x0 if window is minimized, which throws things off
478+
//Just bail and don't draw anything in this case.
479+
//See https://github.com/ngscopeclient/scopehal-apps/issues/893
480+
#ifdef _WIN32
481+
if(glfwGetWindowAttrib(m_window, GLFW_ICONIFIED))
482+
{
483+
this_thread::sleep_for(chrono::milliseconds(10));
484+
return;
485+
}
486+
#endif
487+
}
488+
476489
//If we're re-rendering after the window size changed, fix up the framebuffer before we worry about anything else
477490
if(m_resizeEventPending)
478491
{

0 commit comments

Comments
 (0)