In \src\arch\win32\ui.c, function ui_get_menu_height(), LONG min_y is assigned a value of LONG_MAX.
While this seems correct, it's a slight problem if you compile it with MSYS2 x64 (a rewrite of MSYS) due to an inconsistant data type. Both MSVC and MSYS define LONG as a 32-bit integer, but MSYS2 x64 defines LONG_MAX as a 64-bit integer. min_y therefore overflows and is set to -1. This affects the return value of the function, which then causes the window to appear partially off-screen.
Possible fixes:
set min_y and max_y to INT_MAX and INT_MIN (arbitrary values are acceptable, as there's no way a normal user is going to have a window that far.
Have the conditionals in the main loop always trigger if i==0. (e.g. if (!i || rect.top < min_y){...} )
As a side note, function ui_resize_canvas_window() calls ui_get_menu_height when it can instead use the cached value of menu_height.
Let me get this straight:
And now a new toolchain for windows has come out that has LONG as 32bit, but LONG_MAX as 64bit ??
Ifso, send a bug report to the toolchain makers.
There's two different datatypes. "long" is the compiler-native datatype, and "LONG" is defined for use with the windows API. Certain toolchains, such as Cygwin and their derivatives (including MSYS2), use a 64-bit "long" to maintain compatability with other Unix programs, but need a 32-bit "LONG" in order to interface with the windows API.
Also, window positions and sizes are already limited by a 16-bit integer, with the X and Y coordinates being stuffed into the lower and upper words of an LPARAM for WM_MOVE and WM_SIZE. As such, using LONG_MAX is overkill for a value that can't possibly be greater than INT_MAX (or short for that matter.)
Workaround added in rev. 30208, please retry.