From dead0e1da05dd7aca02f49756bad48ae61923a20 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 23 May 1999 09:24:13 +0000 Subject: [PATCH] Authors: Chris Morgan , James Abbatiello LISTVIEW_KeyDown: Invalidate the listview window only when the selected item changes. --- dlls/comctl32/listview.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index c376432ad68..3024b556572 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5548,6 +5548,7 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) HWND hwndParent = GetParent(hwnd); NMLVKEYDOWN nmKeyDown; NMHDR nmh; + INT oldFocusedItem = infoPtr->nFocusedItem; /* send LVN_KEYDOWN notification */ ZeroMemory(&nmKeyDown, sizeof(NMLVKEYDOWN)); @@ -5736,8 +5737,9 @@ static LRESULT LISTVIEW_KeyDown(HWND hwnd, INT nVirtualKey, LONG lKeyData) break; } - /* refresh client area */ - InvalidateRect(hwnd, NULL, TRUE); + /* refresh client area if necessary*/ + if(oldFocusedItem != infoPtr->nFocusedItem) + InvalidateRect(hwnd, NULL, TRUE); return 0; }