From 8c70ac8da37e73b66879b37b1d1d5e60f0e0c936 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 4 Jan 2023 20:04:40 -0500 Subject: [PATCH 1/2] don't detach console on Windows --- src/winMain.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/winMain.cpp b/src/winMain.cpp index c904b996..853b1153 100644 --- a/src/winMain.cpp +++ b/src/winMain.cpp @@ -22,10 +22,6 @@ typedef HRESULT (*SPDA)(int); int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, PSTR args, int state) { - if (AttachConsole(ATTACH_PARENT_PROCESS)==0) { - if (GetLastError()==ERROR_ACCESS_DENIED) FreeConsole(); - } - int argc=0; wchar_t** argw=CommandLineToArgvW(GetCommandLineW(),&argc); char** argv=new char*[argc+1]; From 8e632577561bc705905af1ec1c31d0d5cb74c39c Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 4 Jan 2023 22:59:21 -0500 Subject: [PATCH 2/2] GUI: fix possible crash in grid mode --- src/gui/insEdit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 66fc5eec..d18776e6 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -1850,6 +1850,7 @@ void FurnaceGUI::drawMacros(std::vector& macros, FurnaceGUI case 2: { int columns=round(ImGui::GetContentRegionAvail().x/(400.0*dpiScale)); int curColumn=0; + if (columns<1) columns=1; if (ImGui::BeginTable("MacroGrid",columns,ImGuiTableFlags_BordersInner)) { for (FurnaceGUIMacroDesc& i: macros) { if (curColumn==0) ImGui::TableNextRow();