=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: shell32/autocomplete: Remove flicker while redrawing the AutoComplete listbox.

Alexandre Julliard julliard at winehq.org
Wed Sep 26 14:22:32 CDT 2018


Module: wine
Branch: master
Commit: aaf0fb5292e262f1831626d3142a7c091e7b8505
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aaf0fb5292e262f1831626d3142a7c091e7b8505

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Tue Sep 25 14:55:27 2018 +0300

shell32/autocomplete: Remove flicker while redrawing the AutoComplete listbox.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/shell32/autocomplete.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index 2153968..b5a053c 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -175,12 +175,15 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_
     if (len + 1 != size)
         text = heap_realloc(text, (len + 1) * sizeof(WCHAR));
 
-    SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0);
-
     /* Set txtbackup to point to text itself (which must not be released) */
     heap_free(ac->txtbackup);
     ac->txtbackup = text;
 
+    if (ac->options & ACO_AUTOSUGGEST)
+    {
+        SendMessageW(ac->hwndListBox, WM_SETREDRAW, FALSE, 0);
+        SendMessageW(ac->hwndListBox, LB_RESETCONTENT, 0, 0);
+    }
     IEnumString_Reset(ac->enumstr);
     for (cpt = 0;;)
     {
@@ -220,12 +223,12 @@ static void autocomplete_text(IAutoCompleteImpl *ac, HWND hwnd, enum autoappend_
             UINT height = SendMessageW(ac->hwndListBox, LB_GETITEMHEIGHT, 0, 0);
             SendMessageW(ac->hwndListBox, LB_CARETOFF, 0, 0);
             GetWindowRect(hwnd, &r);
-            SetParent(ac->hwndListBox, HWND_DESKTOP);
             /* It seems that Windows XP displays 7 lines at most
                and otherwise displays a vertical scroll bar */
             SetWindowPos(ac->hwndListBox, HWND_TOP,
                          r.left, r.bottom + 1, r.right - r.left, height * min(cpt + 1, 7),
                          SWP_SHOWWINDOW );
+            SendMessageW(ac->hwndListBox, WM_SETREDRAW, TRUE, 0);
         }
         else
             ShowWindow(ac->hwndListBox, SW_HIDE);
@@ -438,6 +441,7 @@ static void create_listbox(IAutoCompleteImpl *This)
     if (This->hwndListBox) {
         This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc);
         SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This);
+        SetParent(This->hwndListBox, HWND_DESKTOP);
     }
     else
         This->options &= ~ACO_AUTOSUGGEST;




More information about the wine-cvs mailing list