From 97a5382b50ade50b91fdae308ede769e8742e69e Mon Sep 17 00:00:00 2001 From: The Dax Date: Wed, 22 Jan 2014 17:38:34 -0500 Subject: [PATCH] Win32: Use a hacky workaround to prevent a rare hang when starting up. --- Windows/W32Util/Misc.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Windows/W32Util/Misc.cpp b/Windows/W32Util/Misc.cpp index cb149a845f..9e6adb120e 100644 --- a/Windows/W32Util/Misc.cpp +++ b/Windows/W32Util/Misc.cpp @@ -188,14 +188,20 @@ void GenericListControl::Update() void GenericListControl::ResizeColumns() { - RECT rect; - GetClientRect(handle,&rect); + static volatile bool inResizeColumns = false; + if (inResizeColumns) + return; + inResizeColumns = true; - int totalListSize = rect.right-rect.left; + RECT rect; + GetClientRect(handle, &rect); + + int totalListSize = rect.right - rect.left; for (int i = 0; i < columnCount; i++) { - ListView_SetColumnWidth(handle,i,columns[i].size * totalListSize); + ListView_SetColumnWidth(handle, i, columns[i].size * totalListSize); } + inResizeColumns = false; } LRESULT CALLBACK GenericListControl::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)