Piotr Caban : user32: Don' t do the painting if combobox is not visible in CBPaintText.

Alexandre Julliard julliard at winehq.org
Tue Oct 24 15:36:43 CDT 2017


Module: wine
Branch: master
Commit: 8159af76b4d01c2bd9bc83fb0887ed98bfc6c9e1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8159af76b4d01c2bd9bc83fb0887ed98bfc6c9e1

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Oct 24 17:59:38 2017 +0200

user32: Don't do the painting if combobox is not visible in CBPaintText.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/combo.c     |  2 +-
 dlls/user32/tests/msg.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c
index 149a495..c43d726 100644
--- a/dlls/user32/combo.c
+++ b/dlls/user32/combo.c
@@ -733,7 +733,7 @@ static void CBPaintText(
 	if( lphc->wState & CBF_FOCUSED )
            SendMessageW(lphc->hWndEdit, EM_SETSEL, 0, -1);
    }
-   else /* paint text field ourselves */
+   else if( IsWindowVisible( lphc->self )) /* paint text field ourselves */
    {
      HDC hdc = hdc_paint ? hdc_paint : GetDC(lphc->self);
      UINT itemState = ODS_COMBOBOXEDIT;
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 1b4f6fa..10f4fbd 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -6613,6 +6613,18 @@ static const struct message SetCurSelComboSeq[] =
     { 0 }
 };
 
+static const struct message SetCurSelComboSeq2[] =
+{
+    { CB_SETCURSEL, sent|wparam|lparam, 0, 0 },
+    { LB_SETCURSEL, sent|wparam|lparam, 0, 0 },
+    { LB_SETTOPINDEX, sent|wparam|lparam, 0, 0 },
+    { LB_GETCURSEL, sent|wparam|lparam, 0, 0 },
+    { LB_GETTEXTLEN, sent|wparam|lparam, 0, 0 },
+    { LB_GETTEXTLEN, sent|wparam|lparam|optional, 0, 0 }, /* TODO: it's sent on all Windows versions */
+    { LB_GETTEXT, sent|wparam, 0 },
+    { 0 }
+};
+
 static const struct message WmKeyDownComboSeq[] =
 {
     { WM_KEYDOWN, sent|wparam|lparam, VK_DOWN, 0 },
@@ -6939,6 +6951,13 @@ static void test_combobox_messages(void)
     log_all_parent_messages--;
     ok_sequence(SetCurSelComboSeq, "CB_SETCURSEL on a ComboBox", FALSE);
 
+    ShowWindow(combo, SW_HIDE);
+    flush_sequence();
+    log_all_parent_messages++;
+    SendMessageA(combo, CB_SETCURSEL, 0, 0);
+    log_all_parent_messages--;
+    ok_sequence(SetCurSelComboSeq2, "CB_SETCURSEL on a ComboBox", FALSE);
+
     DestroyWindow(combo);
     DestroyWindow(parent);
 }




More information about the wine-cvs mailing list