diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 7111560445a..27b2fd0971f 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -6,7 +6,7 @@ * Copyright 2000 Jason Mawdsley * Copyright 2001 CodeWeavers Inc. * Copyright 2002 Dimitrie O. Paun - * Copyright 2009-2011 Nikolay Sivov + * Copyright 2009-2012 Nikolay Sivov * Copyright 2009 Owen Rudge for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -4276,6 +4276,10 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL { if (lpLVItem->state & LVIS_FOCUSED) { + /* update selection mark */ + if (infoPtr->nFocusedItem == -1 && infoPtr->nSelectionMark == -1) + infoPtr->nSelectionMark = lpLVItem->iItem; + if (infoPtr->nFocusedItem != -1) { /* remove current focus */ diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index b96e85fcb18..255ef50d140 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2090,7 +2090,6 @@ static void test_multiselect(void) { "using VK_HOME", -1, VK_HOME, 1, -1 } }; - hwnd = create_listview_control(LVS_REPORT); for (i=0;i