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
November 2021
----- 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
951 discussions
Start a n
N
ew thread
Zhiyi Zhang : comctl32/button: Use BS_PUSHLIKE instead of WS_EX_RIGHT in BUTTON_PositionRect().
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 5e16493f71c70c4dc54db8de0900e42fd00417f7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5e16493f71c70c4dc54db8de…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 15:17:51 2021 +0800 comctl32/button: Use BS_PUSHLIKE instead of WS_EX_RIGHT in BUTTON_PositionRect(). BS_PUSHLIKE and WS_EX_RIGHT have the same value and it was a typo to use WS_EX_RIGHT. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index b3331e179cd..fbe060513d2 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -1122,7 +1122,7 @@ static void BUTTON_PositionRect(LONG style, const RECT *outerRect, RECT *innerRe INT width = innerRect->right - innerRect->left; INT height = innerRect->bottom - innerRect->top; - if ((style & WS_EX_RIGHT) && !(style & BS_CENTER)) style |= BS_CENTER; + if ((style & BS_PUSHLIKE) && !(style & BS_CENTER)) style |= BS_CENTER; if (!(style & BS_CENTER)) {
1
0
0
0
Zhiyi Zhang : comctl32/button: Remove useless calculation for drawing group boxes.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: ff5f45f444f0b81d6e387a9d3200ebec7534fe81 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff5f45f444f0b81d6e387a9d…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 15:17:45 2021 +0800 comctl32/button: Remove useless calculation for drawing group boxes. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index b576e6c6db6..b3331e179cd 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -2113,10 +2113,6 @@ static void GB_Paint( const BUTTON_INFO *infoPtr, HDC hDC, UINT action ) labelRect.right++; labelRect.bottom++; FillRect(hDC, &labelRect, hbr); - labelRect.left++; - labelRect.right--; - labelRect.bottom--; - BUTTON_DrawLabel(infoPtr, hDC, dtFlags, &imageRect, &textRect); } SelectClipRgn( hDC, hrgn );
1
0
0
0
Zhiyi Zhang : uxtheme: Implement GetThemeTransitionDuration().
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: c90edc19bba34612180d754c07597f1893d2fec9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c90edc19bba34612180d754c…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:28:08 2021 +0800 uxtheme: Implement GetThemeTransitionDuration(). Fix Nokia SDK 2.0 for Java installer buttons not changing state after clicking. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/metric.c | 30 +++++++++++++++++++++++++++--- dlls/uxtheme/tests/system.c | 22 ++++------------------ 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/dlls/uxtheme/metric.c b/dlls/uxtheme/metric.c index b7c173740d7..3ef199bcca7 100644 --- a/dlls/uxtheme/metric.c +++ b/dlls/uxtheme/metric.c @@ -228,8 +228,32 @@ HRESULT WINAPI GetThemeSysString(HTHEME hTheme, int iStringID, HRESULT WINAPI GetThemeTransitionDuration(HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration) { - FIXME("(%p, %u, %u, %u, %u, %p) stub\n", hTheme, iPartId, iStateIdFrom, iStateIdTo, - iPropId, pdwDuration); + INTLIST intlist; + HRESULT hr; + + TRACE("(%p, %d, %d, %d, %d, %p)\n", hTheme, iPartId, iStateIdFrom, iStateIdTo, iPropId, + pdwDuration); + + if (!pdwDuration || iStateIdFrom < 1 || iStateIdTo < 1) + return E_INVALIDARG; + + hr = GetThemeIntList(hTheme, iPartId, 0, iPropId, &intlist); + if (FAILED(hr)) + { + if (hr == E_PROP_ID_UNSUPPORTED) + *pdwDuration = 0; + + return hr; + } + + if (intlist.iValueCount < 1 || iStateIdFrom > intlist.iValues[0] + || iStateIdTo > intlist.iValues[0] + || intlist.iValueCount != 1 + intlist.iValues[0] * intlist.iValues[0]) + { + *pdwDuration = 0; + return E_INVALIDARG; + } - return E_NOTIMPL; + *pdwDuration = intlist.iValues[1 + intlist.iValues[0] * (iStateIdFrom - 1) + (iStateIdTo - 1)]; + return S_OK; } diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index 57901e6affb..10857115061 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -1329,74 +1329,64 @@ static void test_GetThemeTransitionDuration(void) duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(NULL, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr); ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + /* Crash on Wine. HTHEME is not a pointer that can be directly referenced. */ + if (strcmp(winetest_platform, "wine")) + { duration = 0xdeadbeef; hr = pGetThemeTransitionDuration((HTHEME)0xdeadbeef, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); todo_wine ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr); ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + } duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, 0xdeadbeef, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL - 1, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_DEFAULTED_ANIMATING + 1, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_NORMAL - 1, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING + 1, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, TMT_BACKGROUND, &duration); - todo_wine ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, 0xdeadbeef, &duration); - todo_wine ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, NULL); - todo_wine ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); /* Parts that don't have TMT_TRANSITIONDURATIONS */ @@ -1406,9 +1396,7 @@ static void test_GetThemeTransitionDuration(void) duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_GROUPBOX, GBS_NORMAL, GBS_DISABLED, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); - todo_wine ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); /* Test parsing TMT_TRANSITIONDURATIONS property. TMT_TRANSITIONDURATIONS is a vista+ property */ @@ -1436,10 +1424,8 @@ static void test_GetThemeTransitionDuration(void) duration = 0xdeadbeef; hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, from_state, to_state, TMT_TRANSITIONDURATIONS, &duration); - todo_wine ok(hr == S_OK, "GetThemeTransitionDuration failed, hr %#x.\n", hr); expected = intlist.iValues[1 + intlist.iValues[0] * (from_state - 1) + (to_state - 1)]; - todo_wine ok(duration == expected, "Expected duration %d, got %d.\n", expected, duration); winetest_pop_context();
1
0
0
0
Zhiyi Zhang : uxtheme/tests: Add GetThemeTransitionDuration() tests.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 59007aaeef4ae39ed04b358aafeef2004ecd3522 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=59007aaeef4ae39ed04b358a…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:27:59 2021 +0800 uxtheme/tests: Add GetThemeTransitionDuration() tests. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/tests/system.c | 154 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index 541d46deeaa..57901e6affb 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -43,6 +43,7 @@ static HDC (WINAPI *pGetBufferedPaintDC)(HPAINTBUFFER); static HDC (WINAPI *pGetBufferedPaintTargetDC)(HPAINTBUFFER); static HRESULT (WINAPI *pGetBufferedPaintTargetRect)(HPAINTBUFFER, RECT *); static HRESULT (WINAPI *pGetThemeIntList)(HTHEME, int, int, int, INTLIST *); +static HRESULT (WINAPI *pGetThemeTransitionDuration)(HTHEME, int, int, int, int, DWORD *); static LONG (WINAPI *pDisplayConfigGetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *); static LONG (WINAPI *pDisplayConfigSetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *); @@ -81,6 +82,7 @@ static void init_funcs(void) GET_PROC(uxtheme, GetBufferedPaintTargetDC) GET_PROC(uxtheme, GetBufferedPaintTargetRect) GET_PROC(uxtheme, GetThemeIntList) + GET_PROC(uxtheme, GetThemeTransitionDuration) GET_PROC(uxtheme, OpenThemeDataEx) GET_PROC(uxtheme, OpenThemeDataForDpi) @@ -1299,6 +1301,157 @@ static void test_GetThemeIntList(void) DestroyWindow(hwnd); } +static void test_GetThemeTransitionDuration(void) +{ + int from_state, to_state, expected; + INTLIST intlist; + DWORD duration; + HTHEME theme; + HRESULT hr; + HWND hwnd; + + if (!pGetThemeTransitionDuration || !pGetThemeIntList) + { + win_skip("GetThemeTransitionDuration or GetThemeIntList is unavailable.\n"); + return; + } + + hwnd = CreateWindowA("static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); + theme = OpenThemeData(hwnd, L"Button"); + if (!theme) + { + skip("Theming is not active.\n"); + DestroyWindow(hwnd); + return; + } + + /* Invalid parameter tests */ + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(NULL, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration((HTHEME)0xdeadbeef, BP_PUSHBUTTON, PBS_NORMAL, + PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_HANDLE, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, 0xdeadbeef, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL - 1, PBS_DEFAULTED_ANIMATING, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_DEFAULTED_ANIMATING + 1, + PBS_DEFAULTED_ANIMATING, TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_NORMAL - 1, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + ok(duration == 0xdeadbeef, "Expected duration %#x, got %#x.\n", 0xdeadbeef, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING + 1, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, + TMT_BACKGROUND, &duration); + todo_wine + ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, + 0xdeadbeef, &duration); + todo_wine + ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, PBS_NORMAL, PBS_DEFAULTED_ANIMATING, + TMT_TRANSITIONDURATIONS, NULL); + todo_wine + ok(hr == E_INVALIDARG, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + + /* Parts that don't have TMT_TRANSITIONDURATIONS */ + hr = GetThemeIntList(theme, BP_GROUPBOX, GBS_NORMAL, TMT_TRANSITIONDURATIONS, &intlist); + ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeIntList failed, hr %#x.\n", hr); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_GROUPBOX, GBS_NORMAL, GBS_DISABLED, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == E_PROP_ID_UNSUPPORTED, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + todo_wine + ok(duration == 0, "Expected duration %#x, got %#x.\n", 0, duration); + + /* Test parsing TMT_TRANSITIONDURATIONS property. TMT_TRANSITIONDURATIONS is a vista+ property */ + if (LOBYTE(LOWORD(GetVersion())) < 6) + goto done; + + hr = pGetThemeIntList(theme, BP_PUSHBUTTON, PBS_NORMAL, TMT_TRANSITIONDURATIONS, &intlist); + ok(hr == S_OK, "GetThemeIntList failed, hr %#x.\n", hr); + /* The first value is the theme part state count. The following are the values from every state + * to every state. So the total value count should be 1 + state ^ 2 */ + expected = PBS_DEFAULTED_ANIMATING - PBS_NORMAL + 1; + ok(intlist.iValues[0] == expected, "Expected the first value %d, got %d.\n", expected, + intlist.iValues[0]); + expected = 1 + intlist.iValues[0] * intlist.iValues[0]; + ok(intlist.iValueCount == expected, "Expected value count %d, got %d.\n", expected, + intlist.iValueCount); + if (hr == S_OK) + { + for (from_state = PBS_NORMAL; from_state <= PBS_DEFAULTED_ANIMATING; ++from_state) + { + for (to_state = PBS_NORMAL; to_state <= PBS_DEFAULTED_ANIMATING; ++to_state) + { + winetest_push_context("from state %d to %d", from_state, to_state); + + duration = 0xdeadbeef; + hr = pGetThemeTransitionDuration(theme, BP_PUSHBUTTON, from_state, to_state, + TMT_TRANSITIONDURATIONS, &duration); + todo_wine + ok(hr == S_OK, "GetThemeTransitionDuration failed, hr %#x.\n", hr); + expected = intlist.iValues[1 + intlist.iValues[0] * (from_state - 1) + (to_state - 1)]; + todo_wine + ok(duration == expected, "Expected duration %d, got %d.\n", expected, duration); + + winetest_pop_context(); + } + } + } + +done: + CloseThemeData(theme); + DestroyWindow(hwnd); +} + START_TEST(system) { init_funcs(); @@ -1319,6 +1472,7 @@ START_TEST(system) test_CloseThemeData(); test_buffered_paint(); test_GetThemeIntList(); + test_GetThemeTransitionDuration(); /* Test EnableTheming() in the end because it may disable theming */ test_EnableTheming();
1
0
0
0
Zhiyi Zhang : light.msstyles: Add TMT_TRANSITIONDURATIONS property.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 36ed40e99fffd4fa1e5caee788a9d0562e55cc1b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=36ed40e99fffd4fa1e5caee7…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:27:49 2021 +0800 light.msstyles: Add TMT_TRANSITIONDURATIONS property. Set all transition duration to 100ms for different states and 0ms for the same state. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/light.msstyles/light.rc | 193 +++++++++++++++++++++++++++++++++++++++++++ dlls/uxtheme/tests/system.c | 1 - 2 files changed, 193 insertions(+), 1 deletion(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=36ed40e99fffd4fa1e5c…
1
0
0
0
Zhiyi Zhang : uxtheme: Support TMT_TRANSITIONDURATIONS property.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 2ca5798b2af6bafc81585f82ea7c28b08bf19b98 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2ca5798b2af6bafc81585f82…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:27:38 2021 +0800 uxtheme: Support TMT_TRANSITIONDURATIONS property. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/stylemap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/uxtheme/stylemap.c b/dlls/uxtheme/stylemap.c index a7928348304..c9a23429511 100644 --- a/dlls/uxtheme/stylemap.c +++ b/dlls/uxtheme/stylemap.c @@ -257,6 +257,7 @@ static const MSSTYLES_PROPERTY_MAP mapProperty[] = { {TMT_BOOL, TMT_USERPICTURE, L"USERPICTURE"}, {TMT_RECT, TMT_DEFAULTPANESIZE, L"DEFAULTPANESIZE"}, {TMT_COLOR, TMT_BLENDCOLOR, L"BLENDCOLOR"}, + {TMT_INTLIST, TMT_TRANSITIONDURATIONS, L"TRANSITIONDURATIONS"}, {0, 0, L""} };
1
0
0
0
Zhiyi Zhang : uxtheme: Use vssym32.h instead of tmschema.h.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 18eacc6dc760f86eda543e682496ca37abc86fb0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=18eacc6dc760f86eda543e68…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:27:31 2021 +0800 uxtheme: Use vssym32.h instead of tmschema.h. tmschema.h is obsolete and missing some definitions. The deleted global and menu classes are not used anywhere and not in Windows headers. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/draw.c | 2 +- dlls/uxtheme/metric.c | 2 +- dlls/uxtheme/msstyles.c | 2 +- dlls/uxtheme/property.c | 2 +- dlls/uxtheme/stylemap.c | 62 +++++++------------------------------------------ dlls/uxtheme/system.c | 2 +- include/tmschema.h | 28 ---------------------- include/vsstyle.h | 7 ++++++ 8 files changed, 20 insertions(+), 87 deletions(-) diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c index a03217b65cf..bf294ed3cc8 100644 --- a/dlls/uxtheme/draw.c +++ b/dlls/uxtheme/draw.c @@ -32,7 +32,7 @@ #include "commoncontrols.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "tmschema.h" +#include "vssym32.h" #include "msstyles.h" #include "uxthemedll.h" diff --git a/dlls/uxtheme/metric.c b/dlls/uxtheme/metric.c index 2d5a09d0256..b7c173740d7 100644 --- a/dlls/uxtheme/metric.c +++ b/dlls/uxtheme/metric.c @@ -26,7 +26,7 @@ #include "winuser.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "tmschema.h" +#include "vssym32.h" #include "msstyles.h" diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index f129d998d65..c0f626d54aa 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -28,7 +28,7 @@ #include "winnls.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "tmschema.h" +#include "vssym32.h" #include "msstyles.h" diff --git a/dlls/uxtheme/property.c b/dlls/uxtheme/property.c index 93a72ab9189..188f13836e2 100644 --- a/dlls/uxtheme/property.c +++ b/dlls/uxtheme/property.c @@ -26,7 +26,7 @@ #include "wingdi.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "tmschema.h" +#include "vssym32.h" #include "msstyles.h" diff --git a/dlls/uxtheme/stylemap.c b/dlls/uxtheme/stylemap.c index 4fe254c1e7a..a7928348304 100644 --- a/dlls/uxtheme/stylemap.c +++ b/dlls/uxtheme/stylemap.c @@ -23,9 +23,10 @@ #include "windef.h" #include "winbase.h" #include "winuser.h" -#include "tmschema.h" +#include "vssym32.h" #define TMT_ENUM 200 +#define TMT_STOCKIMAGEFILE 3007 typedef struct _MSSTYLES_PROPERTY_MAP { WORD dwPrimitiveType; @@ -332,24 +333,6 @@ static const MSSTYLES_ENUM_MAP mapEnum[] = { * Defined as PartID,StateID,TextName * If StateID == 0 then its a part being defined */ - -/* These are globals to all classes, but its treated as a separate class */ -static const MSSTYLES_CLASS_MAP classGlobals[] = { - {GP_BORDER, 0, L"BORDER"}, - {GP_BORDER, BSS_FLAT, L"FLAT"}, - {GP_BORDER, BSS_RAISED, L"RAISED"}, - {GP_BORDER, BSS_SUNKEN, L"SUNKEN"}, - {GP_LINEHORZ, 0, L"LINEHORZ"}, - {GP_LINEHORZ, LHS_FLAT, L"FLAT"}, - {GP_LINEHORZ, LHS_RAISED, L"RAISED"}, - {GP_LINEHORZ, LHS_SUNKEN, L"SUNKEN"}, - {GP_LINEVERT, 0, L"LINEVERT"}, - {GP_LINEVERT, LVS_FLAT, L"FLAT"}, - {GP_LINEVERT, LVS_RAISED, L"RAISED"}, - {GP_LINEVERT, LVS_SUNKEN, L"SUNKEN"}, - {0, 0, L""} -}; - static const MSSTYLES_CLASS_MAP classButton[] = { {BP_PUSHBUTTON, 0, L"PUSHBUTTON"}, {BP_PUSHBUTTON, PBS_NORMAL, L"NORMAL"}, @@ -488,11 +471,12 @@ static const MSSTYLES_CLASS_MAP classHeader[] = { static const MSSTYLES_CLASS_MAP classListview[] = { {LVP_LISTITEM, 0, L"LISTITEM"}, - {LVP_LISTITEM, LIS_NORMAL, L"NORMAL"}, - {LVP_LISTITEM, LIS_HOT, L"HOT"}, - {LVP_LISTITEM, LIS_SELECTED, L"SELECTED"}, - {LVP_LISTITEM, LIS_DISABLED, L"DISABLED"}, - {LVP_LISTITEM, LIS_SELECTEDNOTFOCUS, L"SELECTEDNOTFOCUS"}, + {LVP_LISTITEM, LISS_NORMAL, L"NORMAL"}, + {LVP_LISTITEM, LISS_HOT, L"HOT"}, + {LVP_LISTITEM, LISS_SELECTED, L"SELECTED"}, + {LVP_LISTITEM, LISS_DISABLED, L"DISABLED"}, + {LVP_LISTITEM, LISS_SELECTEDNOTFOCUS, L"SELECTEDNOTFOCUS"}, + {LVP_LISTITEM, LISS_HOTSELECTED, L"HOTSELECTED"}, {LVP_LISTGROUP, 0, L"LISTGROUP"}, {LVP_LISTDETAIL, 0, L"LISTDETAIL"}, {LVP_LISTSORTEDDETAIL, 0, L"LISTSORTEDDETAIL"}, @@ -500,34 +484,6 @@ static const MSSTYLES_CLASS_MAP classListview[] = { {0, 0, L""} }; -static const MSSTYLES_CLASS_MAP classMenu[] = { - {MP_MENUITEM, 0, L"MENUITEM"}, - {MP_MENUITEM, MS_NORMAL, L"NORMAL"}, - {MP_MENUITEM, MS_SELECTED, L"SELECTED"}, - {MP_MENUITEM, MS_DEMOTED, L"DEMOTED"}, - {MP_MENUDROPDOWN, 0, L"MENUDROPDOWN"}, - {MP_MENUDROPDOWN, MS_NORMAL, L"NORMAL"}, - {MP_MENUDROPDOWN, MS_SELECTED, L"SELECTED"}, - {MP_MENUDROPDOWN, MS_DEMOTED, L"DEMOTED"}, - {MP_MENUBARITEM, 0, L"MENUBARITEM"}, - {MP_MENUBARITEM, MS_NORMAL, L"NORMAL"}, - {MP_MENUBARITEM, MS_SELECTED, L"SELECTED"}, - {MP_MENUBARITEM, MS_DEMOTED, L"DEMOTED"}, - {MP_MENUBARDROPDOWN, 0, L"MENUBARDROPDOWN"}, - {MP_MENUBARDROPDOWN, MS_NORMAL, L"NORMAL"}, - {MP_MENUBARDROPDOWN, MS_SELECTED, L"SELECTED"}, - {MP_MENUBARDROPDOWN, MS_DEMOTED, L"DEMOTED"}, - {MP_CHEVRON, 0, L"CHEVRON"}, - {MP_CHEVRON, MS_NORMAL, L"NORMAL"}, - {MP_CHEVRON, MS_SELECTED, L"SELECTED"}, - {MP_CHEVRON, MS_DEMOTED, L"DEMOTED"}, - {MP_SEPARATOR, 0, L"SEPARATOR"}, - {MP_SEPARATOR, MS_NORMAL, L"NORMAL"}, - {MP_SEPARATOR, MS_SELECTED, L"SELECTED"}, - {MP_SEPARATOR, MS_DEMOTED, L"DEMOTED"}, - {0, 0, L""} -}; - static const MSSTYLES_CLASS_MAP classMenuband[] = { {MDP_NEWAPPBUTTON, 0, L"NEWAPPBUTTON"}, {MDP_NEWAPPBUTTON, MDS_NORMAL, L"NORMAL"}, @@ -1036,7 +992,6 @@ static const MSSTYLES_CLASS_MAP classWindow[] = { /* Map class names to part/state maps */ static const MSSTYLES_CLASS_NAME mapClass[] = { - {classGlobals, L"GLOBALS"}, {classButton, L"BUTTON"}, {classClock, L"CLOCK"}, {classCombobox, L"COMBOBOX"}, @@ -1044,7 +999,6 @@ static const MSSTYLES_CLASS_NAME mapClass[] = { {classExplorerbar, L"EXPLORERBAR"}, {classHeader, L"HEADER"}, {classListview, L"LISTVIEW"}, - {classMenu, L"MENU"}, {classMenuband, L"MENUBAND"}, {classPage, L"PAGE"}, {classProgress, L"PROGRESS"}, diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c index 0298fe61d4a..ba579a02edc 100644 --- a/dlls/uxtheme/system.c +++ b/dlls/uxtheme/system.c @@ -28,7 +28,7 @@ #include "winreg.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "tmschema.h" +#include "vssym32.h" #include "uxthemedll.h" #include "msstyles.h" diff --git a/include/tmschema.h b/include/tmschema.h index 47eb146ebdc..81bd606d11b 100644 --- a/include/tmschema.h +++ b/include/tmschema.h @@ -594,34 +594,6 @@ BEGIN_TM_PART_STATES(SPECIALGROUPEXPAND) TM_STATE(3, EBSGE, PRESSED) END_TM_PART_STATES() -/* GLOBALS parts */ -BEGIN_TM_CLASS_PARTS(GLOBALS) - TM_PART(1, GP, BORDER) - TM_PART(2, GP, LINEHORZ) - TM_PART(3, GP, LINEVERT) -END_TM_CLASS_PARTS() - -/* GLOBALS - BORDER states */ -BEGIN_TM_PART_STATES(BORDER) - TM_STATE(1, BSS, FLAT) - TM_STATE(2, BSS, RAISED) - TM_STATE(3, BSS, SUNKEN) -END_TM_PART_STATES() - -/* GLOBALS - LINEHORZ states */ -BEGIN_TM_PART_STATES(LINEHORZ) - TM_STATE(1, LHS, FLAT) - TM_STATE(2, LHS, RAISED) - TM_STATE(3, LHS, SUNKEN) -END_TM_PART_STATES() - -/* GLOBAL - LINEVERT states */ -BEGIN_TM_PART_STATES(LINEVERT) - TM_STATE(1, LVS, FLAT) - TM_STATE(2, LVS, RAISED) - TM_STATE(3, LVS, SUNKEN) -END_TM_PART_STATES() - /* HEADER parts */ BEGIN_TM_CLASS_PARTS(HEADER) TM_PART(1, HP, HEADERITEM) diff --git a/include/vsstyle.h b/include/vsstyle.h index c5850111fb3..d6ea9071f64 100644 --- a/include/vsstyle.h +++ b/include/vsstyle.h @@ -1632,6 +1632,13 @@ enum MINBUTTONSTATES { MINBS_DISABLED = 4, }; +enum MAXBUTTONSTATES { + MAXBS_NORMAL = 1, + MAXBS_HOT = 2, + MAXBS_PUSHED = 3, + MAXBS_DISABLED = 4, +}; + enum RESTOREBUTTONSTATES { RBS_NORMAL = 1, RBS_HOT = 2,
1
0
0
0
Zhiyi Zhang : uxtheme/tests: Add GetThemeIntList() tests.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: f86f0aec993afec504c2f57f93d76aa335c4c0b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f86f0aec993afec504c2f57f…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Tue Nov 2 14:27:24 2021 +0800 uxtheme/tests: Add GetThemeIntList() tests. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/uxtheme/tests/system.c | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index f56c3d2c273..7992911bc19 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -28,7 +28,7 @@ #include "ddk/d3dkmthk.h" #include "vfwmsgs.h" #include "uxtheme.h" -#include "vsstyle.h" +#include "vssym32.h" #include "msg.h" #include "wine/test.h" @@ -42,6 +42,7 @@ static HRESULT (WINAPI *pGetBufferedPaintBits)(HPAINTBUFFER, RGBQUAD **, int *); static HDC (WINAPI *pGetBufferedPaintDC)(HPAINTBUFFER); static HDC (WINAPI *pGetBufferedPaintTargetDC)(HPAINTBUFFER); static HRESULT (WINAPI *pGetBufferedPaintTargetRect)(HPAINTBUFFER, RECT *); +static HRESULT (WINAPI *pGetThemeIntList)(HTHEME, int, int, int, INTLIST *); static LONG (WINAPI *pDisplayConfigGetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *); static LONG (WINAPI *pDisplayConfigSetDeviceInfo)(DISPLAYCONFIG_DEVICE_INFO_HEADER *); @@ -79,6 +80,7 @@ static void init_funcs(void) GET_PROC(uxtheme, GetBufferedPaintDC) GET_PROC(uxtheme, GetBufferedPaintTargetDC) GET_PROC(uxtheme, GetBufferedPaintTargetRect) + GET_PROC(uxtheme, GetThemeIntList) GET_PROC(uxtheme, OpenThemeDataEx) GET_PROC(uxtheme, OpenThemeDataForDpi) @@ -1263,6 +1265,41 @@ static void test_EnableTheming(void) } } +static void test_GetThemeIntList(void) +{ + INTLIST intlist; + HTHEME theme; + HRESULT hr; + HWND hwnd; + + if (!pGetThemeIntList) + { + win_skip("GetThemeIntList is unavailable.\n"); + return; + } + + hwnd = CreateWindowA("static", "", WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); + theme = OpenThemeData(hwnd, L"Button"); + if (!theme) + { + skip("Theming is not active.\n"); + DestroyWindow(hwnd); + return; + } + + /* Check properties */ + /* TMT_TRANSITIONDURATIONS is a vista+ property */ + hr = pGetThemeIntList(theme, BP_PUSHBUTTON, PBS_NORMAL, TMT_TRANSITIONDURATIONS, &intlist); + if (LOBYTE(LOWORD(GetVersion())) < 6) + ok(hr == E_PROP_ID_UNSUPPORTED, "Expected %#x, got %#x.\n", E_PROP_ID_UNSUPPORTED, hr); + else + todo_wine + ok(hr == S_OK, "GetThemeIntList failed, hr %#x.\n", hr); + + CloseThemeData(theme); + DestroyWindow(hwnd); +} + START_TEST(system) { init_funcs(); @@ -1282,6 +1319,7 @@ START_TEST(system) test_GetThemePartSize(); test_CloseThemeData(); test_buffered_paint(); + test_GetThemeIntList(); /* Test EnableTheming() in the end because it may disable theming */ test_EnableTheming();
1
0
0
0
Ziqing Hui : server: Also queue hotkey message for WM_SYSKEYDOWN.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 77f1658393b46fd29b998876129b2c4851ac6619 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=77f1658393b46fd29b998876…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Nov 2 10:54:22 2021 +0800 server: Also queue hotkey message for WM_SYSKEYDOWN. ALT and F10 key generate WM_SYSKEYDOWN message. They should also have the ability to queue hotkey message. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 2 +- server/queue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 73737eab98b..c054a145112 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -17699,7 +17699,7 @@ static void test_hotkey(void) } DispatchMessageA(&msg); } - ok_sequence(WmHotkeyPressWithALT, "window hotkey press with ALT", TRUE); + ok_sequence(WmHotkeyPressWithALT, "window hotkey press with ALT", FALSE); keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) diff --git a/server/queue.c b/server/queue.c index 63a3a1fe2db..f7bc28f39e9 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1422,7 +1422,7 @@ static int queue_hotkey_message( struct desktop *desktop, struct message *msg ) struct hotkey *hotkey; unsigned int modifiers = 0; - if (msg->msg != WM_KEYDOWN) return 0; + if (msg->msg != WM_KEYDOWN && msg->msg != WM_SYSKEYDOWN) return 0; if (desktop->keystate[VK_MENU] & 0x80) modifiers |= MOD_ALT; if (desktop->keystate[VK_CONTROL] & 0x80) modifiers |= MOD_CONTROL;
1
0
0
0
Ziqing Hui : user32/tests: Add ALT+letter hotkey tests.
by Alexandre Julliard
02 Nov '21
02 Nov '21
Module: wine Branch: master Commit: 556490d35b78bd847ecfd4594f888ca428bb33eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=556490d35b78bd847ecfd459…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Nov 2 10:54:21 2021 +0800 user32/tests: Add ALT+letter hotkey tests. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/msg.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 4b2495f4197..73737eab98b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -17359,6 +17359,29 @@ static const struct message WmHotkeyNew[] = { { WM_KEYUP, sent, 0, 0x80000001 }, /* lparam not checked so the sequence isn't a todo */ { 0 } }; +static const struct message WmHotkeyPressALT[] = { + { WM_SYSKEYDOWN, kbd_hook|wparam|lparam, VK_LMENU, LLKHF_INJECTED|LLKHF_ALTDOWN }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_MENU, 0x20000001 }, + { WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 }, + { 0 } +}; +static const struct message WmHotkeyPressWithALT[] = { + { WM_SYSKEYDOWN, kbd_hook, 0, LLKHF_INJECTED|LLKHF_ALTDOWN }, /* lparam not checked */ + { WM_HOTKEY, sent|wparam, 6 }, + { 0 } +}; +static const struct message WmHotkeyReleaseWithALT[] = { + { WM_SYSKEYUP, kbd_hook|lparam, 0, LLKHF_INJECTED|LLKHF_UP|LLKHF_ALTDOWN }, + { HCBT_KEYSKIPPED, hook|lparam|optional, 0, 0xa0000001 }, + { WM_SYSKEYUP, sent|lparam, 0, 0xa0000001 }, + { 0 } +}; +static const struct message WmHotkeyReleaseALT[] = { + { WM_KEYUP, kbd_hook|wparam|lparam, VK_LMENU, LLKHF_INJECTED|LLKHF_UP }, + { HCBT_KEYSKIPPED, hook|wparam|lparam|optional, VK_MENU, 0xc0000001 }, + { WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 }, + { 0 } +}; static int hotkey_letter; @@ -17378,9 +17401,12 @@ static LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam msg.descr = "KeyboardHookProc"; add_message(&msg); - if (wParam == WM_KEYUP || wParam == WM_KEYDOWN) + if (wParam == WM_KEYUP || wParam == WM_KEYDOWN || + wParam == WM_SYSKEYUP || wParam == WM_SYSKEYDOWN) { - ok(kdbhookstruct->vkCode == VK_LWIN || kdbhookstruct->vkCode == hotkey_letter, + ok(kdbhookstruct->vkCode == VK_LWIN || + kdbhookstruct->vkCode == VK_LMENU || + kdbhookstruct->vkCode == hotkey_letter, "unexpected keycode %x\n", kdbhookstruct->vkCode); } } @@ -17635,6 +17661,56 @@ static void test_hotkey(void) } ok_sequence(WmHotkeyReleaseLWIN, "thread hotkey release LWIN", FALSE); + /* Search for an ALT + letter combination that hasn't been registered */ + for (hotkey_letter = 0x41; hotkey_letter <= 0x51; hotkey_letter ++) + { + SetLastError(0xdeadbeef); + ret = RegisterHotKey(test_window, 6, MOD_ALT, hotkey_letter); + + if (ret == TRUE) + { + break; + } + else + { + ok(GetLastError() == ERROR_HOTKEY_ALREADY_REGISTERED || broken(GetLastError() == 0xdeadbeef), + "unexpected error %d\n", GetLastError()); + } + } + + if (hotkey_letter == 0x52) + { + ok(0, "Couldn't find any free ALT + letter combination\n"); + goto end; + } + + keybd_event(VK_LMENU, 0, 0, 0); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); + ok_sequence(WmHotkeyPressALT, "window hotkey press ALT", TRUE); + + keybd_event(hotkey_letter, 0, 0, 0); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + { + if (msg.message == WM_HOTKEY) + { + ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd); + ok(msg.lParam == MAKELPARAM(MOD_ALT, hotkey_letter), "unexpected WM_HOTKEY lparam %lx\n", msg.lParam); + } + DispatchMessageA(&msg); + } + ok_sequence(WmHotkeyPressWithALT, "window hotkey press with ALT", TRUE); + + keybd_event(hotkey_letter, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); + ok_sequence(WmHotkeyReleaseWithALT, "window hotkey release with ALT", TRUE); + + keybd_event(VK_LMENU, 0, KEYEVENTF_KEYUP, 0); + while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); + ok_sequence(WmHotkeyReleaseALT, "window hotkey release ALT", FALSE); + /* Unregister thread hotkey */ ret = UnregisterHotKey(NULL, 5); ok(ret == TRUE, "expected TRUE, got %i, err=%d\n", ret, GetLastError()); @@ -17645,6 +17721,7 @@ static void test_hotkey(void) end: UnregisterHotKey(NULL, 5); UnregisterHotKey(test_window, 5); + UnregisterHotKey(test_window, 6); DestroyWindow(test_window); flush_sequence(); }
1
0
0
0
← Newer
1
...
86
87
88
89
90
91
92
...
96
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
Results per page:
10
25
50
100
200