From 85bd2746a0b9199972357347bc86dcc9e101a0e2 Mon Sep 17 00:00:00 2001 From: anders_k Date: Sun, 28 Jun 2020 21:55:37 +0000 Subject: [PATCH] Only perform component list redraw hack on 95/NT4 to avoid flicker git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7190 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 13 +++++++------ Source/exehead/util.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index a88672e6..cc5c6660 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -1236,18 +1236,19 @@ static void FORCE_INLINE NSISCALL RefreshComponents(HWND hwTree, HTREEITEM *item TreeView_SetItem(hwTree, &item); } - // workaround for bug #1397031 + // workaround for bug #1397031 A.K.A #434 // - // windows 95 doesn't erase the background of the state image - // before it draws a new one. because of this parts of the old + // Windows 95 & NT4 doesn't erase the background of the state image + // before it draws a new one. Because of this parts of the old // state image will show where the new state image is masked. // - // to solve this, the following line forces the background to - // be erased. sadly, this redraws the entire control. it might + // To solve this, the following line forces the background to + // be erased. sadly, this redraws the entire control. It might // be a good idea to figure out where the state images are and // redraw only those. - InvalidateRect(hwTree, NULL, TRUE); + if (IsWin95NT4()) // Checking for < IE4 is probably better but more work + InvalidateRect(hwTree, NULL, TRUE); } int NSISCALL TreeGetSelectedSection(HWND tree, BOOL mouse) diff --git a/Source/exehead/util.h b/Source/exehead/util.h index b8b3696a..51f272d2 100644 --- a/Source/exehead/util.h +++ b/Source/exehead/util.h @@ -69,6 +69,7 @@ void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR extern DWORD g_WinVer; // GetVersion() +#define IsWin95NT4() ( sizeof(void*) == 4 && LOBYTE(g_WinVer) == 0x04 ) #define NSIS_WINVER_WOW64FLAG ( sizeof(void*) > 4 ? ( 0 ) : ( 0x40000000 ) ) #define IsWow64() ( sizeof(void*) > 4 ? ( FALSE ) : ( g_WinVer & NSIS_WINVER_WOW64FLAG ) ) #define SystemSupportsAltRegView() ( sizeof(void*) > 4 ? ( TRUE ) : ( IsWow64() ) )