From f0fc0349976924379cc3ae2ff95fb342d7541294 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sun, 10 Dec 2017 21:36:46 +0000 Subject: [PATCH] Revert "user32/combo: Set listbox popup height correctly and add tests.". This partly reverts commit f7f7b89e2e9117811c91269643868c6d063db5e9 (tests are left in place). Any application that currently uses "Microsoft.Windows.Common-Controls v6" via a Manifest has the possibility of breaking comboboxes. Using this version of the control ensures that dropdown for comboboxes, will show multiple items, regardless of its height in the resource. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- dlls/user32/combo.c | 8 ++++++++ dlls/user32/tests/combo.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index c43d726205c..0e64e85464f 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -1044,6 +1044,14 @@ static void CBDropDown( LPHEADCOMBO lphc ) if (nHeight < nDroppedHeight - COMBO_YBORDERSIZE()) nDroppedHeight = nHeight + COMBO_YBORDERSIZE(); + + if (nDroppedHeight < nHeight) + { + if (nItems < 5) + nDroppedHeight = (nItems+1)*nIHeight; + else if (nDroppedHeight < 6*nIHeight) + nDroppedHeight = 6*nIHeight; + } } r.left = rect.left; diff --git a/dlls/user32/tests/combo.c b/dlls/user32/tests/combo.c index 0519ace51c7..72e8777d207 100644 --- a/dlls/user32/tests/combo.c +++ b/dlls/user32/tests/combo.c @@ -718,25 +718,25 @@ static void test_listbox_size(DWORD style) int height_combo; BOOL todo; } info_height[] = { - {2, 24}, + {2, 24, TRUE}, {2, 41, TRUE}, - {2, 42}, - {2, 50}, + {2, 42, TRUE}, + {2, 50, TRUE}, {2, 60}, {2, 80}, {2, 89}, {2, 90}, {2, 100}, - {10, 24}, + {10, 24, TRUE}, {10, 41, TRUE}, - {10, 42}, - {10, 50}, - {10, 60}, - {10, 80}, + {10, 42, TRUE}, + {10, 50, TRUE}, + {10, 60, TRUE}, + {10, 80, TRUE}, {10, 89, TRUE}, - {10, 90}, - {10, 100}, + {10, 90, TRUE}, + {10, 100, TRUE}, }; pGetComboBoxInfo = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "GetComboBoxInfo"); -- 2.11.4.GIT