[PATCH v7 0/1] MR10206: comctl32/treeview: Fixed missing redraw of item being unfocused
Should be self-explanatory. No bug entry or test programs. Currently, specific order of user input causes stuck selected items that go away after full repaint - this change fixes it. -- v7: comctl32/treeview: Fixed missing redraw of item being unfocused https://gitlab.winehq.org/wine/wine/-/merge_requests/10206
From: Piotr Pawłowski <p@perkele.cc> --- dlls/comctl32/treeview.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 8b38f098553..f68df3358fb 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -4318,9 +4318,14 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) if (do_focus) { - infoPtr->focusedItem = ht.hItem; TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem); - TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem); + if (infoPtr->focusedItem != ht.hItem) + { + infoPtr->focusedItem = ht.hItem; + TREEVIEW_InvalidateItem(infoPtr, infoPtr->focusedItem); + } + if (infoPtr->focusedItem != infoPtr->selectedItem) + TREEVIEW_InvalidateItem(infoPtr, infoPtr->selectedItem); } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10206
On Thu Mar 12 19:47:57 2026 +0000, Nikolay Sivov wrote:
I think keeping selection invalidation is still useful. For example when clicking on checkboxes, it's possible to have old selection not repainted, it's lost once you force whole repaint but it's not very nice. Checkbox behavior regarding selection is still incorrect, but that's another thing. P.S. please also keep existing style, with opening braces on a new line. Addressed.
Noted about style, I'll try harder to blend in from now on. Regarding checkboxes vs selection: I can investigate/fix after my current fixes have been merged. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10206#note_132090
Please ignore the message "Fast forward merge is not possible. Please rebase." Rebasing daily is counterproductive; you only need to rebase if there is a conflict with upstream Wine. We should be able to hide that message as soon as https://gitlab.com/gitlab-org/gitlab/-/work_items/895#note_3155822655 is publicly released. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10206#note_132242
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10206
participants (3)
-
Alex Henrie (@alexhenrie) -
Nikolay Sivov (@nsivov) -
Piotr Pawłowski