shithub: drawterm

Download patch

ref: bc5528aa9eefa146f3f08a0bcba8c2a0a6b41271
parent: 74e47cdeb4f9b8d81766c24391bac05f87922115
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Nov 25 12:55:39 EST 2017

gui-win32: call terminit() only after window size has been determined

--- a/gui-win32/screen.c
+++ b/gui-win32/screen.c
@@ -166,7 +166,6 @@
 
 	paletteinit();
 	bmiinit();
-	terminit();
 
 	wc.style = 0;
 	wc.lpfnWndProc = WindowProc;
@@ -201,6 +200,8 @@
 	ShowWindow(window, SW_SHOWDEFAULT);
 	UpdateWindow(window);
 
+	terminit();
+
 	readybit = 1;
 	wakeup(&rend);
 
@@ -347,6 +348,10 @@
 
 	switch(msg) {
 	case WM_CREATE:
+		if(GetClientRect(hwnd, &winr) == 0)
+			break;
+		gscreen->clipr = Rect(0, 0, winr.right - winr.left, winr.bottom - winr.top);
+		rectclip(&gscreen->clipr, gscreen->r);
 		break;
 
 	case WM_SETCURSOR: