nsf / termbox-go

Pure Go termbox implementation
http://godoc.org/github.com/nsf/termbox-go
MIT License
4.66k stars 372 forks source link

Reorder SetConsoleScreenBufferSize and SetConsoleWindowInfo. #202

Closed ipankajg closed 5 years ago

ipankajg commented 5 years ago

This ensures that outer console window is correctly resized.

The issue is shown below and described below the picture. image If you have a console window (on windows 10) with vertical scroll bar (Picture#1 from left), then first calling SetConsoleWindowInfo and then calling SetConsoleScreenBufferSize results in empty space (shown in picture #2 with red rectangle).

The correct way is to reverse these i.e. first change ScreenBufferSize and then the window size. The update_size_maybe() function had the right change, but I missed this in Init() in my previous commit. The picture #3 shows that with this PR, we get the console window size change correctly.