summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xW/xW.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/xW/xW.cpp b/xW/xW.cpp
index d3de8a6..e4733a2 100644
--- a/xW/xW.cpp
+++ b/xW/xW.cpp
@@ -499,7 +499,7 @@ convert_item_formatting(Relay::ItemData *item, CHARFORMAT2 &cf, bool &inverse)
}
static std::vector<BufferLineItem>
-convert_items(std::vector<std::unique_ptr<Relay::ItemData>> &items)
+convert_items(const std::vector<std::unique_ptr<Relay::ItemData>> &items)
{
CHARFORMAT2 cf = default_charformat();
std::vector<BufferLineItem> result;
@@ -1627,6 +1627,21 @@ window_proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (auto b = buffer_by_name(g.buffer_current))
refresh_buffer(*b);
return 0;
+ case WM_SYSCOLORCHANGE:
+ // The topic would flicker with WS_EX_TRANSPARENT.
+ // The buffer only changed its text colour, not background.
+ SendMessage(g.hwndTopic,
+ EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_3DFACE));
+ SendMessage(g.hwndBuffer,
+ EM_SETBKGNDCOLOR, 1, 0);
+
+ // XXX: This is incomplete, we'd have to run convert_items() again;
+ // essentially only COLOR_GRAYTEXT is reloaded in here.
+ if (auto b = buffer_by_name(g.buffer_current))
+ refresh_buffer(*b);
+
+ // Pass it to all child windows, through DefWindowProc().
+ break;
case WM_ACTIVATE:
if (LOWORD(wParam) == WA_INACTIVE)
g.hwndLastFocused = GetFocus();