Respect BL_FLUSH and BL_RESET indications to mswin_status_update.

This commit is contained in:
Bart House
2018-12-02 13:33:07 -08:00
parent 0f679b3109
commit 6ee48481b1
2 changed files with 134 additions and 146 deletions
+6 -9
View File
@@ -298,13 +298,7 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
FillRect(hdc, &clear_rect, status_bg_brush); FillRect(hdc, &clear_rect, status_bg_brush);
// TODO: Put it around for loop instead -- temporary to get a better diff if (data->status_lines != NULL) {
if (data->status_lines == NULL) {
BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
EndPaint(hWnd, &ps);
return 0;
}
data->has_blink_fields = FALSE; data->has_blink_fields = FALSE;
@@ -426,7 +420,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
DrawTextA(hdc, str, vlen, &barrect, DT_LEFT); DrawTextA(hdc, str, vlen, &barrect, DT_LEFT);
} }
DeleteObject(back_brush); DeleteObject(back_brush);
} else { }
else {
if (atr & HL_INVERSE) { if (atr & HL_INVERSE) {
COLORREF tmp = nFg; COLORREF tmp = nFg;
nFg = nBg; nFg = nBg;
@@ -445,7 +440,8 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
/* draw */ /* draw */
DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT); DrawTextW(hdc, wbuf, vlen, &rt, DT_LEFT);
} else { }
else {
/* get bounding rectangle */ /* get bounding rectangle */
GetTextExtentPoint32A(hdc, str, vlen, &sz); GetTextExtentPoint32A(hdc, str, vlen, &sz);
@@ -462,6 +458,7 @@ onWMPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
rt.left = left; rt.left = left;
rt.top += cy; rt.top += cy;
} }
}
BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY); BitBlt(front_buffer_hdc, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
+4 -13
View File
@@ -3015,18 +3015,6 @@ mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color,
logDebug("mswin_status_update(%d, %p, %d, %d, %x, %p)\n", idx, ptr, chg, percent, color, condmasks); logDebug("mswin_status_update(%d, %p, %d, %d, %x, %p)\n", idx, ptr, chg, percent, color, condmasks);
#if 0 // TODO: this code was dead ... do we need to respond to these updates?
switch (idx) {
case BL_RESET:
reset_state = TRUE;
/* FALLTHRU */
case BL_FLUSH:
/* FALLTHRU */
default:
break;
}
#endif
if (idx >= 0) { if (idx >= 0) {
nhassert(idx <= SIZE(_status_fields)); nhassert(idx <= SIZE(_status_fields));
@@ -3101,7 +3089,10 @@ mswin_status_update(int idx, genericptr_t ptr, int chg, int percent, int color,
} }
/* send command to status window */ }
if (idx == BL_FLUSH || idx == BL_RESET) {
/* send command to status window to update */
ZeroMemory(&update_cmd_data, sizeof(update_cmd_data)); ZeroMemory(&update_cmd_data, sizeof(update_cmd_data));
update_cmd_data.status_lines = &_status_lines; update_cmd_data.status_lines = &_status_lines;
SendMessage(mswin_hwnd_from_winid(WIN_STATUS), WM_MSNH_COMMAND, SendMessage(mswin_hwnd_from_winid(WIN_STATUS), WM_MSNH_COMMAND,