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
This commit is contained in:
anders_k 2020-06-28 21:55:37 +00:00
parent d62a4a6a21
commit 85bd2746a0
2 changed files with 8 additions and 6 deletions

View file

@ -1236,18 +1236,19 @@ static void FORCE_INLINE NSISCALL RefreshComponents(HWND hwTree, HTREEITEM *item
TreeView_SetItem(hwTree, &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 // 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 // before it draws a new one. Because of this parts of the old
// state image will show where the new state image is masked. // state image will show where the new state image is masked.
// //
// to solve this, the following line forces the background to // To solve this, the following line forces the background to
// be erased. sadly, this redraws the entire control. it might // be erased. sadly, this redraws the entire control. It might
// be a good idea to figure out where the state images are and // be a good idea to figure out where the state images are and
// redraw only those. // 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) int NSISCALL TreeGetSelectedSection(HWND tree, BOOL mouse)

View file

@ -69,6 +69,7 @@ void NSISCALL myRegGetStr(HKEY root, const TCHAR *sub, const TCHAR *name, TCHAR
extern DWORD g_WinVer; // GetVersion() extern DWORD g_WinVer; // GetVersion()
#define IsWin95NT4() ( sizeof(void*) == 4 && LOBYTE(g_WinVer) == 0x04 )
#define NSIS_WINVER_WOW64FLAG ( sizeof(void*) > 4 ? ( 0 ) : ( 0x40000000 ) ) #define NSIS_WINVER_WOW64FLAG ( sizeof(void*) > 4 ? ( 0 ) : ( 0x40000000 ) )
#define IsWow64() ( sizeof(void*) > 4 ? ( FALSE ) : ( g_WinVer & NSIS_WINVER_WOW64FLAG ) ) #define IsWow64() ( sizeof(void*) > 4 ? ( FALSE ) : ( g_WinVer & NSIS_WINVER_WOW64FLAG ) )
#define SystemSupportsAltRegView() ( sizeof(void*) > 4 ? ( TRUE ) : ( IsWow64() ) ) #define SystemSupportsAltRegView() ( sizeof(void*) > 4 ? ( TRUE ) : ( IsWow64() ) )