[WIN32SS][WINSRV] Optimize console background drawing (#2132)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Thu, 5 Dec 2019 11:19:00 +0000 (20:19 +0900)
committerGitHub <noreply@github.com>
Thu, 5 Dec 2019 11:19:00 +0000 (20:19 +0900)
Console needs speed. This PR will optimize drawing of console.
- Set NULL to the background brush.
- Skip WM_ERASEBKGND.

win32ss/user/winsrv/consrv/frontends/gui/conwnd.c

index 0d81e1d..7676a99 100644 (file)
@@ -149,7 +149,7 @@ RegisterConWndClass(IN HINSTANCE hInstance)
     WndClass.hIcon = ghDefaultIcon;
     WndClass.hIconSm = ghDefaultIconSm;
     WndClass.hCursor = ghDefaultCursor;
-    WndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // The color of a terminal when it is switched off.
+    WndClass.hbrBackground = NULL;
     WndClass.lpszMenuName = NULL;
     WndClass.cbClsExtra = 0;
     WndClass.cbWndExtra = GWLP_CONWND_ALLOC;
@@ -2214,6 +2214,9 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
             if (OnClose(GuiData)) goto Default;
             break;
 
+        case WM_ERASEBKGND:
+            return TRUE;
+
         case WM_PAINT:
             OnPaint(GuiData);
             break;