From 61a39ca22aa302588434cab09a34be57459c83ac Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Mon, 15 Apr 2024 18:21:42 +0200 Subject: [PATCH] [0.4.11][COMCTL32] status.c sizegrip-backports 2024-04-15 This ports back 3 commits: 0.4.15-dev-7861-g a771729e696827e3696699522e63548fecee9550 [COMCTL32] Fix Status Bar Updating (#6696) which fixes CORE-19497 'Regression, part of the statusbar with the sizegrip is not redrawn properly' which regressed on this branch by 0.4.11-release-193-g dafd020c07c78280e5474333ab64ad73f48ffa60 also port back: 0.4.13-dev-888-g 76dfa2b284b03e276b91782eff69fcecdd72210c [COMCTL32] Checking size grip bounds in x-axis only (#991) 0.4.13-dev-887-g b9ddad0bbb2cf7f9501b401d84b6847f695b1ddf [COMCTL32] Hide size grip when the parent window is maximized CORE-15240 (#991) To compensate binary increase, I stripped a few TRACE's and the debugstr_t() function in the older branches. comctl32.dll binary therefore has a tendency to shrink a tiny bit on most branches: comctl32.dll master RosBEWin2.2.2 GCC8.4.0dbg 2.001.408 (0.4.15-dev-7906-g1b85a5f) comctl32.dll 0.4.14rls RosBEWin2.2.1 GCC8.4.0dbg 1.998.336 -> 1.997.824 comctl32.dll 0.4.14rls RosBEWin2.1.6 GCC4.7.2dbg 1.807.872 -> 1.807.360 comctl32.dll 0.4.13rls RosBEWin2.1.6 GCC4.7.2dbg 1.804.800 -> 1.803.264 comctl32.dll 0.4.12rls RosBEWin2.1.6 GCC4.7.2dbg 1.817.600 -> 1.817.088 comctl32.dll 0.4.11rls RosBEWin2.1.6 GCC4.7.2dbg 1.809.920 -> 1.809.408 comctl32.dll 0.4.10rls RosBEWin2.1.6 GCC4.7.2dbg 1.806.848 -> 1.806.848 comctl32.dll 0.4. 9rls RosBEWin2.1.6 GCC4.7.2dbg 1.806.848 -> 1.806.848 comctl32.dll 0.4. 8rls RosBEWin2.1.6 GCC4.7.2dbg 1.633.792 -> 1.632.768 comctl32.dll 0.4. 7rls RosBEWin2.1.6 GCC4.7.2dbg 1.602.048 -> 1.602.048 --- dll/win32/comctl32/status.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/dll/win32/comctl32/status.c b/dll/win32/comctl32/status.c index 02e26b0a9d9..63db0202532 100644 --- a/dll/win32/comctl32/status.c +++ b/dll/win32/comctl32/status.c @@ -95,11 +95,6 @@ STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr); static LRESULT STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd); -static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW) -{ - return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text); -} - static UINT STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr) { @@ -291,7 +286,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc) SelectObject (hdc, hOldFont); - if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) + if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) + && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) STATUSBAR_DrawSizeGrip (theme, hdc, &rect); return 0; @@ -705,11 +701,6 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style, BOOL changed = FALSE; INT oldStyle; - if (style & SBT_OWNERDRAW) { - TRACE("part %d, text %p\n",nPart,text); - } - else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW)); - /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status * window is assumed to be a simple window */ @@ -1004,7 +995,8 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf) static BOOL STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y) { - if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) { + if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) + && !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) { RECT rect; POINT pt; @@ -1014,10 +1006,7 @@ STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y) pt.y = y; ScreenToClient (infoPtr->Self, &pt); - rect.left = rect.right - 13; - rect.top += 2; - - if (PtInRect (&rect, pt)) + if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL)) { if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT; else return HTBOTTOMRIGHT; @@ -1033,7 +1022,6 @@ STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc) { PAINTSTRUCT ps; - TRACE("\n"); if (hdc) return STATUSBAR_Refresh (infoPtr, hdc); hdc = BeginPaint (infoPtr->Self, &ps); STATUSBAR_Refresh (infoPtr, hdc); @@ -1064,7 +1052,6 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text) STATUSWINDOWPART *part; int len; - TRACE("\n"); if (infoPtr->numParts == 0) return FALSE; @@ -1092,7 +1079,6 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags) RECT parent_rect; /* Need to resize width to match parent */ - TRACE("flags %04x\n", flags); if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) { WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n"); @@ -1110,6 +1096,10 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags) y = parent_rect.bottom - infoPtr->height; MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE); STATUSBAR_SetPartBounds (infoPtr); +#ifdef __REACTOS__ + parent_rect = infoPtr->parts[infoPtr->numParts - 1].bound; + InvalidateRect(infoPtr->Self, &parent_rect, TRUE); +#endif return TRUE; }