[0.4.10] Update Scrollbar code to state of master 2023-March-12

by porting back:
0.4.15-dev-5784-g 2aea4ab945 [NTUSER] Scrollbar.c pure whitespace fixes
0.4.15-dev-5680-g 5ad5737370 CORE-18050 [NTUSER] Delete temporary workarounds in co_IntSetScrollInfo() (#4985)
0.4.15-dev-5355-g 0484beb04b CORE-18593 [NTUSER] Don't redraw scrollbar if it is hidden command prompt (#4849)
0.4.15-dev-4492-g 03422451b3 Add '\n' to debug logs (partially, only the scrollbar.c part)
0.4.15-dev-3875-g 977c129f33 CORE-18048 [USER32] SetScrollPos should not bypass UserApiHook (#4372)
0.4.15-dev-3849-g fd28a69de6 CORE-17780 [WIN32SS] Store the scrollbar theming enabled flag in the scrollbar (#4367)
0.4.15-dev-3175-g 222acf5a3e CORE-17777 [NTUSER] Scrollbar.c, Avoid potential out-of-bounds-accesses in co_IntSetScrollInfo()
0.4.15-dev-3174-g dda9c3979e CORE-17769 'Rapps Listview manual resize may erroneously not draw the triangles sometimes'
0.4.15-dev-3147-g 3bf7e3ac13 CORE-17754 and CORE-17755 [NTUSER] Improve Themed Scrollbars by Minimizing Updates (#3953)
0.4.15-dev-3086-g 236649c626 CORE-16375 [UXTHEME][NTUSER] Fix flashing of scrollbar when scrolling (#3868)
0.4.15-dev-2375-g ffea5152e6 [WIN32SS][NTUSER] Fix an integer underflow within scrollbar info setting
0.4.14-dev-1134-g 00adb1a3f9 [WIN32SS] Improve Drawing Scrollbars
- CORE-14755 fixed, flashing scrollbar triangles (we know 131 affected apps just from rapps!)
- CORE-13931 fixed, FamiTracker invisible about-dlg
- CORE-14685 improves a bit, but is not entirely fixed
- CORE-11561 'Notepad scrollbars problem' fixed

This will also speed up NSIS installers that display their file-copy-progress by
a self-scrolling listview.
This commit is contained in:
Joachim Henze 2023-03-12 11:03:05 +01:00
parent 1bb175b0b5
commit dc4ce33558
4 changed files with 269 additions and 300 deletions

View file

@ -571,6 +571,29 @@ dodefault:
return g_user32ApiHook.GetScrollInfo(hwnd, fnBar, lpsi);
}
INT WINAPI ThemeSetScrollInfo(HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
{
PWND_DATA pwndData;
SCROLLINFO siout;
LPSCROLLINFO lpsiout = &siout;
BOOL IsThemed = FALSE;
pwndData = ThemeGetWndData(hWnd);
if (!pwndData)
goto dodefault;
if (pwndData->hthemeScrollbar)
IsThemed = TRUE;
memcpy(&siout, lpsi, sizeof(SCROLLINFO));
if (IsThemed)
siout.fMask |= SIF_THEMED;
dodefault:
return g_user32ApiHook.SetScrollInfo(hWnd, fnBar, lpsiout, bRedraw);
}
/**********************************************************************
* Exports
*/
@ -606,6 +629,7 @@ ThemeInitApiHook(UAPIHK State, PUSERAPIHOOK puah)
puah->SetWindowRgn = ThemeSetWindowRgn;
puah->GetScrollInfo = ThemeGetScrollInfo;
puah->SetScrollInfo = ThemeSetScrollInfo;
UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_NCPAINT);
UAH_HOOK_MESSAGE(puah->DefWndProcArray, WM_NCACTIVATE);

View file

@ -1221,6 +1221,7 @@ extern "C" {
#define SIF_RANGE 1
#define SIF_DISABLENOSCROLL 8
#define SIF_TRACKPOS 16
#define SIF_THEMED 128
#define SWP_DRAWFRAME 32
#define SWP_FRAMECHANGED 32
#define SWP_HIDEWINDOW 128

File diff suppressed because it is too large Load diff

View file

@ -1723,7 +1723,7 @@ SetScrollPos(HWND hWnd, INT nBar, INT nPos, BOOL bRedraw)
ScrollInfo.fMask = SIF_POS|SIF_PREVIOUSPOS;
ScrollInfo.nPos = nPos;
return RealSetScrollInfo(hWnd, nBar, &ScrollInfo, bRedraw);
return SetScrollInfo(hWnd, nBar, &ScrollInfo, bRedraw);
}
/*