From f722fb1155cb3d198c450a68d7db82a0bf6318bf Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Thu, 11 Jun 2020 14:37:45 +0200 Subject: concerted effort to reduce unneccessary redraws on transparent backgrounds --- widgetfactory.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'widgetfactory.cpp') diff --git a/widgetfactory.cpp b/widgetfactory.cpp index 25d0ce1..67d5c5c 100644 --- a/widgetfactory.cpp +++ b/widgetfactory.cpp @@ -178,7 +178,12 @@ commonPanelMessage(void *closure, HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpa } if (msg == WM_SIZE && priv->bgmode == BG_GRADIENT) { + // HACK doing the invalidation before the layout leads to unnecessary + // redraws. I have no idea why, but switching the order of the calls + // makes the problem mostly go away. + LRESULT rv = ALF_Panel_DefWindowProc(hwnd, msg, wparam, lparam); ALF_InvalidateBackground(hwnd); + return rv; } return ALF_Panel_DefWindowProc(hwnd, msg, wparam, lparam); -- cgit v1.2.3