Changing view styles should repaint listviews according to the newly added tests.
From: Zhiyi Zhang zzhang@codeweavers.com
Changing listview view styles should repaint according to the tests in test_WM_STYLECHANGED().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54215 --- dlls/comctl32/listview.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 07bea8574b6..fc22818c37b 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -11212,6 +11212,7 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss) { UINT uNewView, uOldView; + BOOL repaint = FALSE; UINT style;
TRACE("styletype %Ix, styleOld %#lx, styleNew %#lx\n", @@ -11236,6 +11237,8 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, { HIMAGELIST himl;
+ repaint = TRUE; + /* LVM_SETVIEW doesn't change window style bits within LVS_TYPEMASK, changing style updates current view only when view bits change. */ map_style_view(infoPtr); @@ -11297,6 +11300,9 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType, /* add scrollbars if needed */ LISTVIEW_UpdateScroll(infoPtr);
+ if (repaint) + LISTVIEW_InvalidateList(infoPtr); + return 0; }
From: Zhiyi Zhang zzhang@codeweavers.com
Changing view styles should repaint listviews according to the newly added tests. --- dlls/comctl32/tests/misc.c | 65 ++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 27 deletions(-)
diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c index 5613fba15f5..d128c202c67 100644 --- a/dlls/comctl32/tests/misc.c +++ b/dlls/comctl32/tests/misc.c @@ -1021,6 +1021,15 @@ static const struct message wm_stylechanged_combox_seq[] = {0} };
+static const struct message wm_stylechanged_listview_report_seq[] = +{ + {WM_STYLECHANGED, sent}, + {WM_ERASEBKGND, sent | defwinproc}, + {WM_PAINT, sent}, + {WM_ERASEBKGND, sent | defwinproc}, + {0} +}; + static const struct message wm_stylechanged_pager_seq[] = { {WM_STYLECHANGED, sent}, @@ -1081,37 +1090,39 @@ static void test_WM_STYLECHANGED(void) static const struct test { const CHAR *class_name; + DWORD add_style; const struct message *seq; BOOL todo; } tests[] = { - {ANIMATE_CLASSA, wm_stylechanged_seq}, - {WC_BUTTONA, wm_stylechanged_seq}, - {WC_COMBOBOXA, wm_stylechanged_combox_seq, TRUE}, - {WC_COMBOBOXEXA, wm_stylechanged_seq}, - {DATETIMEPICK_CLASSA, wm_stylechanged_seq}, - {WC_EDITA, wm_stylechanged_seq}, - {WC_HEADERA, wm_stylechanged_repaint_seq, TRUE}, - {HOTKEY_CLASSA, wm_stylechanged_seq}, - {WC_IPADDRESSA, wm_stylechanged_seq}, - {WC_LISTBOXA, wm_stylechanged_repaint_seq, TRUE}, - {WC_LISTVIEWA, wm_stylechanged_seq}, - {MONTHCAL_CLASSA, wm_stylechanged_repaint_seq, TRUE}, - {WC_NATIVEFONTCTLA, wm_stylechanged_seq}, - {WC_PAGESCROLLERA, wm_stylechanged_pager_seq, TRUE}, - {PROGRESS_CLASSA, wm_stylechanged_progress_seq}, - {REBARCLASSNAMEA, wm_stylechanged_seq}, - {WC_STATICA, wm_stylechanged_seq}, - {STATUSCLASSNAMEA, wm_stylechanged_seq}, - {"SysLink", wm_stylechanged_seq}, - {WC_TABCONTROLA, wm_stylechanged_seq}, - {TOOLBARCLASSNAMEA, wm_stylechanged_seq}, - {TOOLTIPS_CLASSA, wm_stylechanged_seq}, - {TRACKBAR_CLASSA, wm_stylechanged_trackbar_seq, TRUE}, - {WC_TREEVIEWA, wm_stylechanged_seq}, - {UPDOWN_CLASSA, wm_stylechanged_seq}, - {WC_SCROLLBARA, wm_stylechanged_seq}, + {ANIMATE_CLASSA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_BUTTONA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_COMBOBOXA, WS_TABSTOP, wm_stylechanged_combox_seq, TRUE}, + {WC_COMBOBOXEXA, WS_TABSTOP, wm_stylechanged_seq}, + {DATETIMEPICK_CLASSA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_EDITA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_HEADERA, WS_TABSTOP, wm_stylechanged_repaint_seq, TRUE}, + {HOTKEY_CLASSA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_IPADDRESSA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_LISTBOXA, WS_TABSTOP, wm_stylechanged_repaint_seq, TRUE}, + {WC_LISTVIEWA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_LISTVIEWA, LVS_REPORT, wm_stylechanged_listview_report_seq, TRUE}, + {MONTHCAL_CLASSA, WS_TABSTOP, wm_stylechanged_repaint_seq, TRUE}, + {WC_NATIVEFONTCTLA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_PAGESCROLLERA, WS_TABSTOP, wm_stylechanged_pager_seq, TRUE}, + {PROGRESS_CLASSA, WS_TABSTOP, wm_stylechanged_progress_seq}, + {REBARCLASSNAMEA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_STATICA, WS_TABSTOP, wm_stylechanged_seq}, + {STATUSCLASSNAMEA, WS_TABSTOP, wm_stylechanged_seq}, + {"SysLink", WS_TABSTOP, wm_stylechanged_seq}, + {WC_TABCONTROLA, WS_TABSTOP, wm_stylechanged_seq}, + {TOOLBARCLASSNAMEA, WS_TABSTOP, wm_stylechanged_seq}, + {TOOLTIPS_CLASSA, WS_TABSTOP, wm_stylechanged_seq}, + {TRACKBAR_CLASSA, WS_TABSTOP, wm_stylechanged_trackbar_seq, TRUE}, + {WC_TREEVIEWA, WS_TABSTOP, wm_stylechanged_seq}, + {UPDOWN_CLASSA, WS_TABSTOP, wm_stylechanged_seq}, + {WC_SCROLLBARA, WS_TABSTOP, wm_stylechanged_seq}, };
parent = CreateWindowA(WC_STATICA, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100, @@ -1137,7 +1148,7 @@ static void test_WM_STYLECHANGED(void) flush_sequences(sequences, NUM_MSG_SEQUENCES);
style.styleOld = GetWindowLongA(hwnd, GWL_STYLE); - style.styleNew = style.styleOld | WS_TABSTOP; + style.styleNew = style.styleOld | tests[i].add_style; SendMessageA(hwnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM)&style); flush_events(); ok_sequence(sequences, CHILD_SEQ_INDEX, tests[i].seq, "WM_STYLECHANGED", tests[i].todo);
This merge request was approved by Nikolay Sivov.