Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/user32/listbox.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 3949610e50..95f6a23a28 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1473,19 +1473,23 @@ static void LISTBOX_MakeItemVisible( LB_DESCR *descr, INT index, BOOL fully ) */ static LRESULT LISTBOX_SetCaretIndex( LB_DESCR *descr, INT index, BOOL fully_visible ) { - INT oldfocus = descr->focus_item; + BOOL focus_changed = descr->focus_item != index;
- TRACE("old focus %d, index %d\n", oldfocus, index); + TRACE("old focus %d, index %d\n", descr->focus_item, index);
if (descr->style & LBS_NOSEL) return LB_ERR; if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; - if (index == oldfocus) return LB_OKAY;
- LISTBOX_DrawFocusRect( descr, FALSE ); - descr->focus_item = index; + if (focus_changed) + { + LISTBOX_DrawFocusRect( descr, FALSE ); + descr->focus_item = index; + }
LISTBOX_MakeItemVisible( descr, index, fully_visible ); - LISTBOX_DrawFocusRect( descr, TRUE ); + + if (focus_changed) + LISTBOX_DrawFocusRect( descr, TRUE );
return LB_OKAY; }
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47459 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/user32/listbox.c | 4 ++++ dlls/user32/tests/listbox.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 95f6a23a28..65b052eb62 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -2963,7 +2963,11 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam case LB_SETSEL: ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE ); if (ret != LB_ERR && wParam) + { descr->anchor_item = lParam; + if (lParam != -1) + LISTBOX_SetCaretIndex( descr, lParam, TRUE ); + } return ret;
case LB_SETCURSEL: diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 9f6f45990f..cd372f8ac5 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -583,21 +583,29 @@ static void test_LB_SETSEL(void)
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == -1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 0); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 0, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, FALSE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
DestroyWindow(list);
@@ -607,21 +615,29 @@ static void test_LB_SETSEL(void)
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == -1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 0); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 0, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, FALSE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
DestroyWindow(list); }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/listbox.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 0d6dcd6a0b..2b8c2ba086 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -1462,19 +1462,23 @@ static void LISTBOX_MakeItemVisible( LB_DESCR *descr, INT index, BOOL fully ) */ static LRESULT LISTBOX_SetCaretIndex( LB_DESCR *descr, INT index, BOOL fully_visible ) { - INT oldfocus = descr->focus_item; + BOOL focus_changed = descr->focus_item != index;
- TRACE("old focus %d, index %d\n", oldfocus, index); + TRACE("old focus %d, index %d\n", descr->focus_item, index);
if (descr->style & LBS_NOSEL) return LB_ERR; if ((index < 0) || (index >= descr->nb_items)) return LB_ERR; - if (index == oldfocus) return LB_OKAY;
- LISTBOX_DrawFocusRect( descr, FALSE ); - descr->focus_item = index; + if (focus_changed) + { + LISTBOX_DrawFocusRect( descr, FALSE ); + descr->focus_item = index; + }
LISTBOX_MakeItemVisible( descr, index, fully_visible ); - LISTBOX_DrawFocusRect( descr, TRUE ); + + if (focus_changed) + LISTBOX_DrawFocusRect( descr, TRUE );
return LB_OKAY; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=61863
Your paranoid android.
=== debian10 (64 bit WoW report) ===
user32: clipboard.c:717: Test failed: 5: gle 5 clipboard.c:719: Test failed: 5: gle 1418 clipboard.c:746: Test failed: 5: count 2 clipboard.c:749: Test failed: 5: gle 1418 clipboard.c:755: Test failed: 5: 0002 not available clipboard.c:755: Test failed: 5: 0008 not available clipboard.c:755: Test failed: 5: 0011 not available clipboard.c:757: Test failed: 5: count 2 instead of 3 clipboard.c:765: Test failed: 5.0: got 0003 instead of 0002
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47459 Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/comctl32/listbox.c | 4 ++++ dlls/comctl32/tests/listbox.c | 12 ++++++++++++ 2 files changed, 16 insertions(+)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 2b8c2ba086..f9b4e0aeaf 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -2858,7 +2858,11 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, case LB_SETSEL: ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE ); if (ret != LB_ERR && wParam) + { descr->anchor_item = lParam; + if (lParam != -1) + LISTBOX_SetCaretIndex( descr, lParam, TRUE ); + } return ret;
case LB_SETCURSEL: diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index a3769423ee..4d44137e4d 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -707,16 +707,22 @@ static void test_LB_SETSEL(void) ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 0, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, FALSE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
DestroyWindow(list);
@@ -731,16 +737,22 @@ static void test_LB_SETSEL(void) ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 0, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 0, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, TRUE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
ret = SendMessageA(list, LB_SETSEL, FALSE, 1); ok(ret == 0, "Unexpected return value %d.\n", ret); ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0); ok(ret == 1, "Unexpected anchor index %d.\n", ret); + ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0); + ok(ret == 1, "Unexpected caret index %d.\n", ret);
DestroyWindow(list); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=61864
Your paranoid android.
=== debian10 (32 bit report) ===
user32: msg.c:8782: Test failed: WaitForSingleObject failed 102 msg.c:8788: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8788: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8788: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
=== debian10 (32 bit Chinese:China report) ===
user32: msg.c:8782: Test failed: WaitForSingleObject failed 102 msg.c:8788: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8788: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8788: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=61861
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
user32: clipboard.c:1168: Test failed: OpenClipboard failed: 5 clipboard.c:1170: Test failed: EmptyClipboard failed: 1418 clipboard.c:1172: Test failed: CloseClipboard failed: 1418 clipboard.c:1174: Test failed: sequence diff 0 clipboard.c:1017: Test failed: wait failed clipboard.c:1174: Test failed: WM_DRAWCLIPBOARD not received clipboard.c:1174: Test failed: WM_CLIPBOARDUPDATE not received clipboard.c:1199: Test failed: WM_DESTROYCLIPBOARD received
On 12/11/19 3:29 PM, Marvin wrote:
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=61861
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
user32: clipboard.c:1168: Test failed: OpenClipboard failed: 5 clipboard.c:1170: Test failed: EmptyClipboard failed: 1418 clipboard.c:1172: Test failed: CloseClipboard failed: 1418 clipboard.c:1174: Test failed: sequence diff 0 clipboard.c:1017: Test failed: wait failed clipboard.c:1174: Test failed: WM_DRAWCLIPBOARD not received clipboard.c:1174: Test failed: WM_CLIPBOARDUPDATE not received clipboard.c:1199: Test failed: WM_DESTROYCLIPBOARD received
That happens on its own from time to time.