diff options
author | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-10-05 09:09:48 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeffrey.armstrong@approximatrix.com> | 2021-10-05 09:09:48 -0400 |
commit | b3676102a2ca1578220ef585d933732825ac196e (patch) | |
tree | 2c224a5aeb7d86669cb1732df1f7967aecbb4816 /RadTerminal.cpp | |
parent | 7fe31126d121e810dd93641ae6582e9ab1dac16e (diff) | |
download | RadTerminal-b3676102a2ca1578220ef585d933732825ac196e.tar.gz RadTerminal-b3676102a2ca1578220ef585d933732825ac196e.zip |
Fixed handling of blank commands
Diffstat (limited to 'RadTerminal.cpp')
-rw-r--r-- | RadTerminal.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/RadTerminal.cpp b/RadTerminal.cpp index 5dae48e..57842c5 100644 --- a/RadTerminal.cpp +++ b/RadTerminal.cpp @@ -219,7 +219,7 @@ extern "C" { if (fontFace != NULL) rtc.strFontFace = std::tstring(fontFace); - if (command != NULL) + if (command != NULL && wcslen(command) > 0) rtc.strCommand = std::tstring(command); if (working_directory != NULL) @@ -240,7 +240,7 @@ extern "C" { if (darkMode) { SetWindowTheme(hRet, L"DarkMode_Explorer", NULL); // Needed for scrollbar - AllowDarkModeForWindow(hRet, true); + //AllowDarkModeForWindow(hRet, true); } return hRet; @@ -998,9 +998,17 @@ void RadTerminalWindowOnPaint(HWND hWnd) HBITMAP hbitmap = CreateCompatibleBitmap(hdc, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top); HBITMAP hbitmapold = SelectBitmap(hmemdc, hbitmap); - HBRUSH hBrush = (HBRUSH) GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND); - if (hBrush != NULL) - FillRect(hmemdc, &ps.rcPaint, hBrush); + //HBRUSH hBrush = (HBRUSH) GetClassLongPtr(hWnd, GCLP_HBRBACKGROUND); + //if (hBrush != NULL) + // FillRect(hmemdc, &ps.rcPaint, hBrush); + COLORREF bkgd = RGB(color_default_pallette[TSM_COLOR_BACKGROUND][0], + color_default_pallette[TSM_COLOR_BACKGROUND][1], + color_default_pallette[TSM_COLOR_BACKGROUND][2]); + HBRUSH hbkgd = CreateSolidBrush(bkgd); + if (hbkgd != NULL) { + FillRect(hmemdc, &ps.rcPaint, hbkgd); + DeleteObject(hbkgd); + } tsm_screen_draw_data draw = {}; draw.hdc = hmemdc; @@ -1529,7 +1537,7 @@ LRESULT CALLBACK RadTerminalWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR HANDLE_MSG(hWnd, WM_RBUTTONDOWN, RadTerminalWindowOnRButtonDown); HANDLE_MSG(hWnd, WM_TIMER, RadTerminalWindowOnTimer); HANDLE_MSG(hWnd, WM_SIZE, RadTerminalWindowOnSize); - HANDLE_MSG(hWnd, WM_SIZING, RadTerminalWindowOnSizing); + //HANDLE_MSG(hWnd, WM_SIZING, RadTerminalWindowOnSizing); HANDLE_MSG(hWnd, WM_VSCROLL, RadTerminalWindowOnVScroll); HANDLE_MSG(hWnd, WM_DROPFILES, RadTerminalWindowOnDropFiles); HANDLE_MSG(hWnd, WM_COMMAND, RadTerminalWindowOnCommand); |