winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1097 discussions
Start a n
N
ew thread
Józef Kucia : vkd3d: Ignore redundant IASetPrimitiveTopology() calls.
by Alexandre Julliard
19 Mar '19
19 Mar '19
Module: vkd3d Branch: master Commit: f3c9229cc342c4d9c10f52a61dde1fff48a74a93 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=f3c9229cc342c4d9c10f52a…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Mar 19 14:40:58 2019 +0100 vkd3d: Ignore redundant IASetPrimitiveTopology() calls. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d/command.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 33dfcaf..40c48cd 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3008,6 +3008,9 @@ static void STDMETHODCALLTYPE d3d12_command_list_IASetPrimitiveTopology(ID3D12Gr return; } + if (list->primitive_topology == topology) + return; + list->primitive_topology = topology; d3d12_command_list_invalidate_current_pipeline(list); }
1
0
0
0
Akihiro Sagawa : user32/tests: Tests default margin size with various font face.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 3e61c7127ed7eb764a8b308fd8897cbc26a93a4a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3e61c7127ed7eb764a8b308f…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:28 2019 +0900 user32/tests: Tests default margin size with various font face. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 71 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 21bd833..b1223a9 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1549,7 +1549,7 @@ static void test_margins_usefontinfo(UINT charset) DeleteObject(hfont); } -static void test_margins_default(UINT charset) +static void test_margins_default(const char* facename, UINT charset) { HWND hwnd; HDC hdc; @@ -1567,7 +1567,7 @@ static void test_margins_default(UINT charset) lf.lfHeight = -11; lf.lfWeight = FW_NORMAL; lf.lfCharSet = charset; - strcpy(lf.lfFaceName, "Tahoma"); + strcpy(lf.lfFaceName, facename); hfont = CreateFontIndirectA(&lf); ok(hfont != NULL, "got %p\n", hfont); @@ -1602,16 +1602,16 @@ static void test_margins_default(UINT charset) SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + ok(margins == expect, "%s:%d: got %d, %d\n", facename, charset, HIWORD(margins), LOWORD(margins)); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + ok(margins == expect, "%s:%d: got %d, %d\n", facename, charset, HIWORD(margins), LOWORD(margins)); else { - ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); - ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); + ok(HIWORD(margins) <= HIWORD(expect), "%s:%d: got %d\n", facename, charset, HIWORD(margins)); + ok(LOWORD(margins) <= LOWORD(expect), "%s:%d: got %d\n", facename, charset, LOWORD(margins)); } DestroyWindow(hwnd); @@ -1627,22 +1627,39 @@ static void test_margins_default(UINT charset) SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + ok(margins == expect, "%s:%d: got %d, %d\n", facename, charset, HIWORD(margins), LOWORD(margins)); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + ok(margins == expect, "%s:%d: got %d, %d\n", facename, charset, HIWORD(margins), LOWORD(margins)); else { - ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); - ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); + ok(HIWORD(margins) <= HIWORD(expect), "%s:%d: got %d\n", facename, charset, HIWORD(margins)); + ok(LOWORD(margins) <= LOWORD(expect), "%s:%d: got %d\n", facename, charset, LOWORD(margins)); } DestroyWindow(hwnd); DeleteObject(hfont); } +static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) +{ + return 0; +} + +static BOOL is_font_installed(const char*name) +{ + HDC hdc = GetDC(NULL); + BOOL ret = FALSE; + + if (!EnumFontFamiliesA(hdc, name, find_font_proc, 0)) + ret = TRUE; + + ReleaseDC(NULL, hdc); + return ret; +} + static void test_margins(void) { HWND hwEdit; @@ -1718,17 +1735,26 @@ static void test_margins(void) test_margins_usefontinfo(DEFAULT_CHARSET); - test_margins_default(ANSI_CHARSET); - test_margins_default(EASTEUROPE_CHARSET); + test_margins_default("Tahoma", ANSI_CHARSET); + test_margins_default("Tahoma", EASTEUROPE_CHARSET); - test_margins_default(SHIFTJIS_CHARSET); - test_margins_default(HANGUL_CHARSET); - test_margins_default(CHINESEBIG5_CHARSET); -} + test_margins_default("Tahoma", HANGUL_CHARSET); + test_margins_default("Tahoma", CHINESEBIG5_CHARSET); -static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) -{ - return 0; + if (is_font_installed("MS PGothic")) + test_margins_default("MS PGothic", SHIFTJIS_CHARSET); + else + skip("MS PGothic is not available, skipping some margin tests\n"); + + if (is_font_installed("Ume P Gothic")) + test_margins_default("Ume P Gothic", SHIFTJIS_CHARSET); + else + skip("Ume P Gothic is not available, skipping some margin tests\n"); + + if (is_font_installed("SimSun")) + test_margins_default("SimSun", GB2312_CHARSET); + else + skip("SimSun is not available, skipping some margin tests\n"); } static void test_margins_font_change(void) @@ -1737,15 +1763,12 @@ static void test_margins_font_change(void) DWORD margins, font_margins; LOGFONTA lf; HFONT hfont, hfont2; - HDC hdc = GetDC(0); - if(EnumFontFamiliesA(hdc, "Arial", find_font_proc, 0)) + if (!is_font_installed("Arial")) { - trace("Arial not found - skipping font change margin tests\n"); - ReleaseDC(0, hdc); + skip("Arial not found - skipping font change margin tests\n"); return; } - ReleaseDC(0, hdc); hwEdit = create_child_editcontrol(0, 0);
1
0
0
0
Akihiro Sagawa : user32/tests: Add Unicode version tests for Edit control margins.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 11f059707482e6d26dde3afe8a54f96cc8cc2cac URL:
https://source.winehq.org/git/wine.git/?a=commit;h=11f059707482e6d26dde3afe…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:26 2019 +0900 user32/tests: Add Unicode version tests for Edit control margins. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 107f190..21bd833 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1561,6 +1561,7 @@ static void test_margins_default(UINT charset) RECT rect; INT margins, expect; const UINT small_margins = MAKELONG(1, 5); + const WCHAR EditW[] = {'E','d','i','t',0}, strW[] = {'W',0}; memset(&lf, 0, sizeof(lf)); lf.lfHeight = -11; @@ -1571,8 +1572,8 @@ static void test_margins_default(UINT charset) hfont = CreateFontIndirectA(&lf); ok(hfont != NULL, "got %p\n", hfont); - /* Big window rectangle */ - hwnd = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 5000, 1000, NULL, NULL, NULL, NULL); + /* Unicode version */ + hwnd = CreateWindowExW(0, EditW, strW, WS_POPUP, 0, 0, 5000, 1000, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "got %p\n", hwnd); GetClientRect(hwnd, &rect); ok(!IsRectEmpty(&rect), "got rect %s\n", wine_dbgstr_rect(&rect)); @@ -1614,6 +1615,31 @@ static void test_margins_default(UINT charset) } DestroyWindow(hwnd); + /* ANSI version */ + hwnd = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 5000, 1000, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "got %p\n", hwnd); + GetClientRect(hwnd, &rect); + ok(!IsRectEmpty(&rect), "got rect %s\n", wine_dbgstr_rect(&rect)); + + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + ok(margins == 0, "got %x\n", margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + if (!cjk_charset) + ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + if (!cjk_charset) + ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + else + { + ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); + ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); + } + DestroyWindow(hwnd); + DeleteObject(hfont); }
1
0
0
0
Akihiro Sagawa : user32/tests: Move the default margin size tests into a separate function.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: c29f5803490db0e807d96e062e04f263ee593f72 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c29f5803490db0e807d96e06…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:24 2019 +0900 user32/tests: Move the default margin size tests into a separate function. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 93 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 41ed07a..107f190 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1451,7 +1451,6 @@ static void test_margins_usefontinfo(UINT charset) HDC hdc; TEXTMETRICW tm; SIZE size; - BOOL cjk_charset; LOGFONTA lf; HFONT hfont; RECT rect; @@ -1486,29 +1485,14 @@ static void test_margins_usefontinfo(UINT charset) return; } expect = MAKELONG(size.cx / 2, size.cx / 2); - cjk_charset = is_cjk_charset(hdc); - hfont = SelectObject(hdc, hfont); ReleaseDC(hwnd, hdc); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); ok(margins == 0, "got %x\n", margins); - SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); - margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); - if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); - SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); - margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); - if (!cjk_charset) - ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); - else - { - ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); - ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); - expect = margins; - } + expect = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); DestroyWindow(hwnd); threshold = HIWORD(expect) + LOWORD(expect) + size.cx * 2; @@ -1565,6 +1549,74 @@ static void test_margins_usefontinfo(UINT charset) DeleteObject(hfont); } +static void test_margins_default(UINT charset) +{ + HWND hwnd; + HDC hdc; + TEXTMETRICW tm; + SIZE size; + BOOL cjk_charset; + LOGFONTA lf; + HFONT hfont; + RECT rect; + INT margins, expect; + const UINT small_margins = MAKELONG(1, 5); + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = -11; + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = charset; + strcpy(lf.lfFaceName, "Tahoma"); + + hfont = CreateFontIndirectA(&lf); + ok(hfont != NULL, "got %p\n", hfont); + + /* Big window rectangle */ + hwnd = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 5000, 1000, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "got %p\n", hwnd); + GetClientRect(hwnd, &rect); + ok(!IsRectEmpty(&rect), "got rect %s\n", wine_dbgstr_rect(&rect)); + + hdc = GetDC(hwnd); + hfont = SelectObject(hdc, hfont); + size.cx = GdiGetCharDimensions( hdc, &tm, &size.cy ); + if ((charset != tm.tmCharSet && charset != DEFAULT_CHARSET) || + !(tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR))) { + skip("%s for charset %d isn't available\n", lf.lfFaceName, charset); + hfont = SelectObject(hdc, hfont); + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + DeleteObject(hfont); + return; + } + expect = MAKELONG(size.cx / 2, size.cx / 2); + cjk_charset = is_cjk_charset(hdc); + + hfont = SelectObject(hdc, hfont); + ReleaseDC(hwnd, hdc); + + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + ok(margins == 0, "got %x\n", margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + if (!cjk_charset) + ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + if (!cjk_charset) + ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + else + { + ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); + ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); + } + DestroyWindow(hwnd); + + DeleteObject(hfont); +} + static void test_margins(void) { HWND hwEdit; @@ -1639,6 +1691,13 @@ static void test_margins(void) but not by < Win 8 and Win 10. */ test_margins_usefontinfo(DEFAULT_CHARSET); + + test_margins_default(ANSI_CHARSET); + test_margins_default(EASTEUROPE_CHARSET); + + test_margins_default(SHIFTJIS_CHARSET); + test_margins_default(HANGUL_CHARSET); + test_margins_default(CHINESEBIG5_CHARSET); } static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam)
1
0
0
0
Akihiro Sagawa : user32: Fix minimum control size conditions when using EC_USEFONTINFO.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 2b6f45066b903541205f55a8683691625b6cd07f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b6f45066b903541205f55a8…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:22 2019 +0900 user32: Fix minimum control size conditions when using EC_USEFONTINFO. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/edit.c | 47 +++++++++++++---------------------------------- dlls/user32/tests/edit.c | 13 +------------ 2 files changed, 14 insertions(+), 46 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 6f8f412..d1659b4 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -2850,26 +2850,10 @@ static void EDIT_EM_SetLimitText(EDITSTATE *es, UINT limit) * action wParam despite what the docs say. EC_USEFONTINFO calculates the * margin according to the textmetrics of the current font. * - * When EC_USEFONTINFO is used in the non_cjk case the margins only - * change if the edit control is equal to or larger than a certain - * size. Though there is an exception for the empty client rect case - * with small font sizes. + * When EC_USEFONTINFO is used, the margins only change if the edit control is + * equal to or larger than a certain size. The empty client rect is treated as + * 80 pixels width. */ -static BOOL is_cjk(UINT charset) -{ - switch(charset) - { - case SHIFTJIS_CHARSET: - case HANGUL_CHARSET: - case GB2312_CHARSET: - case CHINESEBIG5_CHARSET: - return TRUE; - } - /* HANGUL_CHARSET is strange, though treated as CJK by Win 8, it is - * not by other versions including Win 10. */ - return FALSE; -} - static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, WORD left, WORD right, BOOL repaint) { @@ -2881,25 +2865,20 @@ static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, if (es->font && (left == EC_USEFONTINFO || right == EC_USEFONTINFO)) { HDC dc = GetDC(es->hwndSelf); HFONT old_font = SelectObject(dc, es->font); - LONG width = GdiGetCharDimensions(dc, &tm, NULL); + LONG width = GdiGetCharDimensions(dc, &tm, NULL), rc_width; RECT rc; /* The default margins are only non zero for TrueType or Vector fonts */ if (tm.tmPitchAndFamily & ( TMPF_VECTOR | TMPF_TRUETYPE )) { - if (!is_cjk(tm.tmCharSet)) { - default_left_margin = width / 2; - default_right_margin = width / 2; - - GetClientRect(es->hwndSelf, &rc); - if (rc.right - rc.left < (width / 2 + width) * 2 && - (width >= 28 || !IsRectEmpty(&rc)) ) { - default_left_margin = es->left_margin; - default_right_margin = es->right_margin; - } - } else { - /* FIXME: figure out the CJK values. They are not affected by the client rect. */ - default_left_margin = width / 2; - default_right_margin = width / 2; + /* FIXME: figure out the CJK values. */ + default_left_margin = width / 2; + default_right_margin = width / 2; + + GetClientRect(es->hwndSelf, &rc); + rc_width = !IsRectEmpty(&rc) ? rc.right - rc.left : 80; + if (rc_width < default_left_margin + default_right_margin + width * 2) { + default_left_margin = es->left_margin; + default_right_margin = es->right_margin; } } SelectObject(dc, old_font); diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 72fad2d..41ed07a 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1451,7 +1451,7 @@ static void test_margins_usefontinfo(UINT charset) HDC hdc; TEXTMETRICW tm; SIZE size; - BOOL cjk = FALSE, cjk_charset; + BOOL cjk_charset; LOGFONTA lf; HFONT hfont; RECT rect; @@ -1486,16 +1486,6 @@ static void test_margins_usefontinfo(UINT charset) return; } expect = MAKELONG(size.cx / 2, size.cx / 2); - - charset = GetTextCharset(hdc); - switch (charset) - { - case SHIFTJIS_CHARSET: - case HANGUL_CHARSET: - case GB2312_CHARSET: - case CHINESEBIG5_CHARSET: - cjk = TRUE; - } cjk_charset = is_cjk_charset(hdc); hfont = SelectObject(hdc, hfont); @@ -1537,7 +1527,6 @@ static void test_margins_usefontinfo(UINT charset) SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); - todo_wine_if(cjk) ok(margins == small_margins, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); DestroyWindow(hwnd);
1
0
0
0
Akihiro Sagawa : user32/tests: Use EM_SETMARGINS to test EC_USEFONTINFO margins.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 71523aeae9a729ef64c55f216a76492ac60b9605 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=71523aeae9a729ef64c55f21…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:21 2019 +0900 user32/tests: Use EM_SETMARGINS to test EC_USEFONTINFO margins. Tests assume that WM_SETFONT margins are equal to EM_SETMARGINS with EC_USEFONTINFO ones. This isn't true when font's charset is CJK. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 326d7ec..72fad2d 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1435,17 +1435,28 @@ static void test_edit_control_scroll(void) DestroyWindow (hwEdit); } +static BOOL is_cjk_charset(HDC dc) +{ + switch (GdiGetCodePage(dc)) { + case 932: case 936: case 949: case 950: case 1361: + return TRUE; + default: + return FALSE; + } +} + static void test_margins_usefontinfo(UINT charset) { HWND hwnd; HDC hdc; TEXTMETRICW tm; SIZE size; - BOOL cjk = FALSE; + BOOL cjk = FALSE, cjk_charset; LOGFONTA lf; HFONT hfont; RECT rect; - INT margins, threshold, expect, empty_expect, small_expect; + INT margins, threshold, expect, empty_expect; + const UINT small_margins = MAKELONG(1, 5); memset(&lf, 0, sizeof(lf)); lf.lfHeight = -11; @@ -1475,8 +1486,6 @@ static void test_margins_usefontinfo(UINT charset) return; } expect = MAKELONG(size.cx / 2, size.cx / 2); - small_expect = 0; - empty_expect = size.cx >= 28 ? small_expect : expect; charset = GetTextCharset(hdc); switch (charset) @@ -1487,26 +1496,35 @@ static void test_margins_usefontinfo(UINT charset) case CHINESEBIG5_CHARSET: cjk = TRUE; } + cjk_charset = is_cjk_charset(hdc); hfont = SelectObject(hdc, hfont); ReleaseDC(hwnd, hdc); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); ok(margins == 0, "got %x\n", margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); - if (!cjk) + if (!cjk_charset) + ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); + margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); + if (!cjk_charset) ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); else { - ok(HIWORD(margins) > 0 && LOWORD(margins) > 0, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); - expect = empty_expect = small_expect = margins; + ok(HIWORD(margins) <= HIWORD(expect), "%d: got %d\n", charset, HIWORD(margins)); + ok(LOWORD(margins) <= LOWORD(expect), "%d: got %d\n", charset, LOWORD(margins)); + expect = margins; } DestroyWindow(hwnd); - threshold = (size.cx / 2 + size.cx) * 2; + threshold = HIWORD(expect) + LOWORD(expect) + size.cx * 2; + empty_expect = threshold > 80 ? small_margins : expect; - /* Size below which non-cjk margins are zero */ + /* Size below the threshold, margins remain unchanged */ hwnd = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, threshold - 1, 100, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "got %p\n", hwnd); GetClientRect(hwnd, &rect); @@ -1516,11 +1534,14 @@ static void test_margins_usefontinfo(UINT charset) ok(margins == 0, "got %x\n", margins); SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); - ok(margins == small_expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); + todo_wine_if(cjk) + ok(margins == small_margins, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); DestroyWindow(hwnd); - /* Size at which non-cjk margins become non-zero */ + /* Size at the threshold, margins become non-zero */ hwnd = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, threshold, 100, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "got %p\n", hwnd); GetClientRect(hwnd, &rect); @@ -1530,6 +1551,8 @@ static void test_margins_usefontinfo(UINT charset) ok(margins == 0, "got %x\n", margins); SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); ok(margins == expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); DestroyWindow(hwnd); @@ -1544,6 +1567,8 @@ static void test_margins_usefontinfo(UINT charset) ok(margins == 0, "got %x\n", margins); SendMessageA(hwnd, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, small_margins); + SendMessageA(hwnd, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO, EC_USEFONTINFO)); margins = SendMessageA(hwnd, EM_GETMARGINS, 0, 0); ok(margins == empty_expect, "%d: got %d, %d\n", charset, HIWORD(margins), LOWORD(margins)); DestroyWindow(hwnd);
1
0
0
0
Akihiro Sagawa : user32/tests: Skip margin tests if a font for the target charset isn't available.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: bde955f12b0bfeec767825737093a06b54a0a3aa URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bde955f12b0bfeec76782573…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu Mar 14 23:55:19 2019 +0900 user32/tests: Skip margin tests if a font for the target charset isn't available. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/edit.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 00c05fd..326d7ec 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1439,6 +1439,7 @@ static void test_margins_usefontinfo(UINT charset) { HWND hwnd; HDC hdc; + TEXTMETRICW tm; SIZE size; BOOL cjk = FALSE; LOGFONTA lf; @@ -1463,7 +1464,16 @@ static void test_margins_usefontinfo(UINT charset) hdc = GetDC(hwnd); hfont = SelectObject(hdc, hfont); - size.cx = GdiGetCharDimensions( hdc, NULL, &size.cy ); + size.cx = GdiGetCharDimensions( hdc, &tm, &size.cy ); + if ((charset != tm.tmCharSet && charset != DEFAULT_CHARSET) || + !(tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR))) { + skip("%s for charset %d isn't available\n", lf.lfFaceName, charset); + hfont = SelectObject(hdc, hfont); + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + DeleteObject(hfont); + return; + } expect = MAKELONG(size.cx / 2, size.cx / 2); small_expect = 0; empty_expect = size.cx >= 28 ? small_expect : expect;
1
0
0
0
Louis Lenders : explorerframe: Return S_OK in ITaskbarList3 ThumbBarUpdateButtons method.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: be6a113190edeedd1f95f99cd84851dd311f807e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be6a113190edeedd1f95f99c…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Mon Mar 18 17:42:27 2019 +0100 explorerframe: Return S_OK in ITaskbarList3 ThumbBarUpdateButtons method. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45429
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/explorerframe/taskbarlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/explorerframe/taskbarlist.c b/dlls/explorerframe/taskbarlist.c index f029cb5..10ad84b 100644 --- a/dlls/explorerframe/taskbarlist.c +++ b/dlls/explorerframe/taskbarlist.c @@ -205,9 +205,9 @@ static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarUpdateButtons(ITaskbarList UINT cButtons, LPTHUMBBUTTON pButton) { - FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub!\n", iface, hwnd, cButtons, pButton); + FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface, hwnd, cButtons, pButton); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarSetImageList(ITaskbarList4 *iface,
1
0
0
0
Louis Lenders : explorerframe: Return S_OK in ITaskbarList3 ThumbBarAddButtons.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 570ea014770fd62997be81e88f03829eded98390 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=570ea014770fd62997be81e8…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Mon Mar 18 17:42:26 2019 +0100 explorerframe: Return S_OK in ITaskbarList3 ThumbBarAddButtons. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45429
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/explorerframe/taskbarlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/explorerframe/taskbarlist.c b/dlls/explorerframe/taskbarlist.c index afcd7bf..f029cb5 100644 --- a/dlls/explorerframe/taskbarlist.c +++ b/dlls/explorerframe/taskbarlist.c @@ -195,9 +195,9 @@ static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarAddButtons(ITaskbarList4 * UINT cButtons, LPTHUMBBUTTON pButton) { - FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub!\n", iface, hwnd, cButtons, pButton); + FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface, hwnd, cButtons, pButton); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarUpdateButtons(ITaskbarList4 *iface,
1
0
0
0
Louis Lenders : explorerframe: Return S_OK in ITaskbarList3 SetThumbnailTooltip method.
by Alexandre Julliard
18 Mar '19
18 Mar '19
Module: wine Branch: master Commit: 978b7c34740755d8d667e8fdefb126224a3aa866 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=978b7c34740755d8d667e8fd…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Mon Mar 18 17:42:25 2019 +0100 explorerframe: Return S_OK in ITaskbarList3 SetThumbnailTooltip method. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=45429
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/explorerframe/taskbarlist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/explorerframe/taskbarlist.c b/dlls/explorerframe/taskbarlist.c index a50f8a9..afcd7bf 100644 --- a/dlls/explorerframe/taskbarlist.c +++ b/dlls/explorerframe/taskbarlist.c @@ -234,9 +234,9 @@ static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailTooltip(ITaskbarList4 HWND hwnd, LPCWSTR pszTip) { - FIXME("iface %p, hwnd %p, pszTip %s stub!\n", iface, hwnd, debugstr_w(pszTip)); + FIXME("iface %p, hwnd %p, pszTip %s stub, faking success!\n", iface, hwnd, debugstr_w(pszTip)); - return E_NOTIMPL; + return S_OK; } static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailClip(ITaskbarList4 *iface,
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
110
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200