From 42cf8c43b3c8333aafdc5c69b16a9802849adf10 Mon Sep 17 00:00:00 2001 From: Jonathan Campbell Date: Fri, 31 Jan 2020 08:12:59 -0800 Subject: [PATCH] Debugger: When initializing the debugger in Windows, resize the terminal to a smaller maximum. Windows 10 (or pdcurses?) likes to pick a default that cannot fit on the screen without the user having to manually move it to the top.. which the DWM then auto maximizes. --- src/debug/debug_gui.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/debug/debug_gui.cpp b/src/debug/debug_gui.cpp index b82150aec..7f50970dc 100644 --- a/src/debug/debug_gui.cpp +++ b/src/debug/debug_gui.cpp @@ -542,6 +542,21 @@ void DBGUI_StartUp(void) { LOG(LOG_MISC,LOG_DEBUG)("DEBUG GUI startup"); /* Start the main window */ dbg.win_main=initscr(); + +#ifdef WIN32 + /* Tell Windows 10 we DONT want a thin tall console window that fills the screen top to bottom. + It's a nuisance especially when the user attempts to move the windwo up to the top to see + the status, only for Windows to auto-maximize. 30 lines is enough, thanks. */ + { + if (dbg.win_main) { + int win_main_maxy, win_main_maxx; getmaxyx(dbg.win_main, win_main_maxy, win_main_maxx); + if (win_main_maxx > 100) win_main_maxy = 100; + if (win_main_maxy > 40) win_main_maxy = 40; + resize_term(win_main_maxy, win_main_maxx); + } + } +#endif + cbreak(); /* take input chars one at a time, no wait for \n */ noecho(); /* don't echo input */ scrollok(stdscr,false);