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
January 2018
----- 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
638 discussions
Start a n
N
ew thread
Nikolay Sivov : user32: Enable window class redirection.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: bdb048a50e2c9a051dc08f15b4667088830a3b63 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bdb048a50e2c9a051dc08f15…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 26 14:51:41 2018 +0300 user32: Enable window class redirection. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/class.c | 79 +++++++++++++++++++++++++++++++++++++++++------ dlls/user32/tests/class.c | 9 ------ 2 files changed, 69 insertions(+), 19 deletions(-) diff --git a/dlls/user32/class.c b/dlls/user32/class.c index fae88f2..8aa568d 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -161,6 +161,32 @@ static BOOL is_comctl32_class( const WCHAR *name ) return FALSE; } +static BOOL is_builtin_class( const WCHAR *name ) +{ + static const WCHAR classesW[][20] = + { + {'B','u','t','t','o','n',0}, + {'C','o','m','b','o','B','o','x',0}, + {'C','o','m','b','o','L','B','o','x',0}, + {'E','d','i','t',0}, + {'I','M','E',0}, + {'L','i','s','t','B','o','x',0}, + {'M','D','I','C','l','i','e','n','t',0}, + {'S','c','r','o','l','l','b','a','r',0}, + {'S','t','a','t','i','c',0}, + }; + + int min = 0, max = (sizeof(classesW) / sizeof(classesW[0])) - 1; + + while (min <= max) + { + int res, pos = (min + max) / 2; + if (!(res = strcmpiW( name, classesW[pos] ))) return TRUE; + if (res < 0) max = pos - 1; + else min = pos + 1; + } + return FALSE; +} /*********************************************************************** * set_server_info @@ -299,6 +325,32 @@ static void CLASS_FreeClass( CLASS *classPtr ) USER_Unlock(); } +static const WCHAR *CLASS_GetVersionedName( const WCHAR *name ) +{ + ACTCTX_SECTION_KEYED_DATA data; + struct wndclass_redirect_data + { + ULONG size; + DWORD res; + ULONG name_len; + ULONG name_offset; + ULONG module_len; + ULONG module_offset; + } *wndclass; + + if (IS_INTRESOURCE( name )) + return name; + + if (is_comctl32_class( name ) || is_builtin_class( name )) + return name; + + data.cbSize = sizeof(data); + if (!FindActCtxSectionStringW(0, NULL, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION, name, &data)) + return name; + + wndclass = (struct wndclass_redirect_data *)data.lpData; + return (const WCHAR *)((BYTE *)wndclass + wndclass->name_offset); +} /*********************************************************************** * CLASS_FindClass @@ -315,6 +367,8 @@ static CLASS *CLASS_FindClass( LPCWSTR name, HINSTANCE hinstance ) if (!name) return NULL; + name = CLASS_GetVersionedName( name ); + for (;;) { USER_Lock(); @@ -561,6 +615,8 @@ ATOM WINAPI RegisterClassW( const WNDCLASSW* wc ) */ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) { + const WCHAR *classname = NULL; + WCHAR name[MAX_ATOM_LEN + 1]; ATOM atom; CLASS *classPtr; HINSTANCE instance; @@ -577,10 +633,9 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) if (!IS_INTRESOURCE(wc->lpszClassName)) { - WCHAR name[MAX_ATOM_LEN + 1]; - if (!MultiByteToWideChar( CP_ACP, 0, wc->lpszClassName, -1, name, MAX_ATOM_LEN + 1 )) return 0; - classPtr = CLASS_RegisterClass( name, instance, !(wc->style & CS_GLOBALCLASS), + classname = CLASS_GetVersionedName( name ); + classPtr = CLASS_RegisterClass( classname, instance, !(wc->style & CS_GLOBALCLASS), wc->style, wc->cbClsExtra, wc->cbWndExtra ); } else @@ -592,9 +647,9 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) if (!classPtr) return 0; atom = classPtr->atomName; - TRACE("name=%s atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", - debugstr_a(wc->lpszClassName), atom, wc->lpfnWndProc, instance, wc->hbrBackground, - wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); + TRACE("name=%s%s%s atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", + debugstr_a(wc->lpszClassName), classname != name ? "->" : "", classname != name ? debugstr_w(classname) : "", + atom, wc->lpfnWndProc, instance, wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); classPtr->hIcon = wc->hIcon; classPtr->hIconSm = wc->hIconSm; @@ -617,6 +672,7 @@ ATOM WINAPI RegisterClassExA( const WNDCLASSEXA* wc ) */ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc ) { + const WCHAR *classname; ATOM atom; CLASS *classPtr; HINSTANCE instance; @@ -631,15 +687,17 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc ) } if (!(instance = wc->hInstance)) instance = GetModuleHandleW( NULL ); - if (!(classPtr = CLASS_RegisterClass( wc->lpszClassName, instance, !(wc->style & CS_GLOBALCLASS), + classname = CLASS_GetVersionedName( wc->lpszClassName ); + if (!(classPtr = CLASS_RegisterClass( classname, instance, !(wc->style & CS_GLOBALCLASS), wc->style, wc->cbClsExtra, wc->cbWndExtra ))) return 0; atom = classPtr->atomName; - TRACE("name=%s atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", - debugstr_w(wc->lpszClassName), atom, wc->lpfnWndProc, instance, wc->hbrBackground, - wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); + TRACE("name=%s%s%s atom=%04x wndproc=%p hinst=%p bg=%p style=%08x clsExt=%d winExt=%d class=%p\n", + debugstr_w(wc->lpszClassName), classname != wc->lpszClassName ? "->" : "", + classname != wc->lpszClassName ? debugstr_w(classname) : "", atom, wc->lpfnWndProc, instance, + wc->hbrBackground, wc->style, wc->cbClsExtra, wc->cbWndExtra, classPtr ); classPtr->hIcon = wc->hIcon; classPtr->hIconSm = wc->hIconSm; @@ -682,6 +740,7 @@ BOOL WINAPI UnregisterClassW( LPCWSTR className, HINSTANCE hInstance ) GetDesktopWindow(); /* create the desktop window to trigger builtin class registration */ + className = CLASS_GetVersionedName( className ); SERVER_START_REQ( destroy_class ) { req->instance = wine_server_client_ptr( hInstance ); diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index dd8f266..88e4bfc 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -1243,7 +1243,6 @@ static void test_actctx_classes(void) ok(ret, "Failed to get class info.\n"); ret = GetClassInfoA(hinst, "4.3.2.1!MyTestClass", &wc); -todo_wine ok(ret, "Failed to get class info.\n"); ret = UnregisterClassA("MyTestClass", hinst); @@ -1262,7 +1261,6 @@ todo_wine wc.lpszClassName = "MyTestClass"; class = RegisterClassA(&wc); -todo_wine ok(class == 0, "Expected failure.\n"); ret = DeactivateActCtx(0, cookie); @@ -1277,28 +1275,23 @@ todo_wine wc.lpszClassName = "MyTestClass"; class = RegisterClassA(&wc); -todo_wine ok(class != 0, "Failed to register class\n"); ret = DeactivateActCtx(0, cookie); ok(ret, "Failed to deactivate context.\n"); ret = GetClassInfoA(hinst, "MyTestClass", &wc); -todo_wine ok(!ret, "Expected failure.\n"); ret = GetClassInfoA(hinst, "4.3.2.1!MyTestClass", &wc); -todo_wine ok(ret, "Failed to get class info.\n"); ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst); -todo_wine ok(ret, "Failed to unregister class.\n"); /* Register regular name first, it's not considered when versioned name is registered. */ wc.lpszClassName = "MyTestClass"; class = RegisterClassA(&wc); -todo_wine ok(class != 0, "Failed to register class.\n"); ret = ActivateActCtx(context, &cookie); @@ -1306,14 +1299,12 @@ todo_wine wc.lpszClassName = "MyTestClass"; class = RegisterClassA(&wc); -todo_wine ok(class != 0, "Failed to register class.\n"); ret = DeactivateActCtx(0, cookie); ok(ret, "Failed to deactivate context.\n"); ret = UnregisterClassA("4.3.2.1!MyTestClass", hinst); -todo_wine ok(ret, "Failed to unregister class.\n"); ret = UnregisterClassA("MyTestClass", hinst);
1
0
0
0
Alexandre Julliard : winex11: Default to an ARGB visual when depth is set to 32.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: 31c7a7157d991d3d60ff8985fa1061c9eb97142a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=31c7a7157d991d3d60ff8985…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 13:39:22 2018 +0100 winex11: Default to an ARGB visual when depth is set to 32. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/x11drv_main.c | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index a2ec18b..e67a3c0 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -484,11 +484,29 @@ static void init_visuals( Display *display, int screen ) int count; XVisualInfo *info; + argb_visual.screen = screen; + argb_visual.class = TrueColor; + argb_visual.depth = 32; + argb_visual.red_mask = 0xff0000; + argb_visual.green_mask = 0x00ff00; + argb_visual.blue_mask = 0x0000ff; + + if ((info = XGetVisualInfo( display, VisualScreenMask | VisualDepthMask | VisualClassMask | + VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask, + &argb_visual, &count ))) + { + argb_visual = *info; + XFree( info ); + } + default_visual.screen = screen; if (default_visual.depth) /* depth specified */ { - info = XGetVisualInfo( display, VisualScreenMask | VisualDepthMask, &default_visual, &count ); - if (info) + if (default_visual.depth == 32 && argb_visual.visual) + { + default_visual = argb_visual; + } + else if ((info = XGetVisualInfo( display, VisualScreenMask | VisualDepthMask, &default_visual, &count ))) { default_visual = *info; XFree( info ); @@ -510,20 +528,6 @@ static void init_visuals( Display *display, int screen ) } default_colormap = XCreateColormap( display, root_window, default_visual.visual, AllocNone ); - argb_visual.screen = screen; - argb_visual.class = TrueColor; - argb_visual.depth = 32; - argb_visual.red_mask = 0xff0000; - argb_visual.green_mask = 0x00ff00; - argb_visual.blue_mask = 0x0000ff; - - if ((info = XGetVisualInfo( display, VisualScreenMask | VisualDepthMask | VisualClassMask | - VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask, - &argb_visual, &count ))) - { - argb_visual = *info; - XFree( info ); - } TRACE( "default visual %lx class %u argb %lx\n", default_visual.visualid, default_visual.class, argb_visual.visualid ); }
1
0
0
0
Alexandre Julliard : winex11: Support using an ARGB visual as default visual.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: e40ff92e7c80082c449c480e457cba7525e0bbcd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e40ff92e7c80082c449c480e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 13:39:03 2018 +0100 winex11: Support using an ARGB visual as default visual. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/systray.c | 4 ++-- dlls/winex11.drv/window.c | 17 ++++++++++------- dlls/winex11.drv/x11drv.h | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/winex11.drv/systray.c b/dlls/winex11.drv/systray.c index 815e554..da322e0 100644 --- a/dlls/winex11.drv/systray.c +++ b/dlls/winex11.drv/systray.c @@ -644,14 +644,14 @@ static void dock_systray_icon( Display *display, struct tray_icon *icon, Window get_systray_visual_info( display, systray_window, &visual ); - icon->layered = (visual.visualid != default_visual.visualid); + icon->layered = (visual.depth == 32); icon->window = CreateWindowExW( icon->layered ? WS_EX_LAYERED : 0, icon_classname, NULL, WS_CLIPSIBLINGS | WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, icon_cx, icon_cy, NULL, NULL, NULL, icon ); if (!(data = get_win_data( icon->window ))) return; - if (icon->layered) set_window_visual( data, &visual ); + if (icon->layered) set_window_visual( data, &visual, TRUE ); make_window_embedded( data ); window = data->whole_window; release_win_data( data ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a7651fb..a6101ad 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1557,16 +1557,19 @@ static void destroy_whole_window( struct x11drv_win_data *data, BOOL already_des * * Change the visual by destroying and recreating the X window if needed. */ -void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis ) +void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ) { Window client_window = data->client_window; Window whole_window = data->whole_window; + if (!data->use_alpha == !use_alpha) return; + if (data->surface) window_surface_release( data->surface ); + data->surface = NULL; + data->use_alpha = use_alpha; + if (data->vis.visualid == vis->visualid) return; data->client_window = 0; destroy_whole_window( data, client_window != 0 /* don't destroy whole_window until reparented */ ); - if (data->surface) window_surface_release( data->surface ); - data->surface = NULL; data->vis = *vis; create_whole_window( data ); if (!client_window) return; @@ -1613,7 +1616,7 @@ void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) if (offset == GWL_EXSTYLE && (changed & WS_EX_LAYERED)) /* changing WS_EX_LAYERED resets attributes */ { data->layered = FALSE; - set_window_visual( data, &default_visual ); + set_window_visual( data, &default_visual, FALSE ); sync_window_opacity( data->display, data->whole_window, 0, 0, 0 ); if (data->surface) set_surface_color_key( data->surface, CLR_INVALID ); } @@ -2197,7 +2200,7 @@ void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flag if (!data->whole_window && !data->embedded) goto done; if (swp_flags & SWP_HIDEWINDOW) goto done; - if (data->vis.visualid != default_visual.visualid) goto done; + if (data->use_alpha) goto done; if (!get_surface_rect( visible_rect, &surface_rect )) goto done; if (*surface) window_surface_release( *surface ); @@ -2502,7 +2505,7 @@ void CDECL X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alph if (data) { - set_window_visual( data, &default_visual ); + set_window_visual( data, &default_visual, FALSE ); if (data->whole_window) sync_window_opacity( data->display, data->whole_window, key, alpha, flags ); @@ -2558,7 +2561,7 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO if (!(data = get_win_data( hwnd ))) return FALSE; data->layered = TRUE; - if (!data->embedded && argb_visual.visualid) set_window_visual( data, &argb_visual ); + if (!data->embedded && argb_visual.visualid) set_window_visual( data, &argb_visual, TRUE ); rect = *window_rect; OffsetRect( &rect, -window_rect->left, -window_rect->top ); diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 938ff22..eca0dc5 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -562,6 +562,7 @@ struct x11drv_win_data BOOL embedded : 1; /* is window an XEMBED client? */ BOOL shaped : 1; /* is window using a custom region shape? */ BOOL layered : 1; /* is window layered and with valid attributes? */ + BOOL use_alpha : 1; /* does window use an alpha channel? */ int wm_state; /* current value of the WM_STATE property */ DWORD net_wm_state; /* bit mask of active x11drv_net_wm_state values */ Window embedder; /* window id of embedder */ @@ -589,7 +590,7 @@ extern void read_net_wm_states( Display *display, struct x11drv_win_data *data ) extern void update_net_wm_states( struct x11drv_win_data *data ) DECLSPEC_HIDDEN; extern void make_window_embedded( struct x11drv_win_data *data ) DECLSPEC_HIDDEN; extern Window create_client_window( struct x11drv_win_data *data, const XVisualInfo *visual ) DECLSPEC_HIDDEN; -extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis ) DECLSPEC_HIDDEN; +extern void set_window_visual( struct x11drv_win_data *data, const XVisualInfo *vis, BOOL use_alpha ) DECLSPEC_HIDDEN; extern void change_systray_owner( Display *display, Window systray_window ) DECLSPEC_HIDDEN; extern void update_systray_balloon_position(void) DECLSPEC_HIDDEN; extern HWND create_foreign_window( Display *display, Window window ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : winex11: Force the alpha bits in the window surface for 32-bit visuals.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: dcf526b5b1d1929af58a83254b6b54437bbc794e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dcf526b5b1d1929af58a8325…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 13:37:44 2018 +0100 winex11: Force the alpha bits in the window surface for 32-bit visuals. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/bitblt.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 80256dc..6a858c1 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1067,8 +1067,8 @@ static inline BOOL image_needs_byteswap( XImage *image, BOOL is_r8g8b8, int bit_ /* copy image bits with byte swapping and/or pixel mapping */ static void copy_image_byteswap( BITMAPINFO *info, const unsigned char *src, unsigned char *dst, - int src_stride, int dst_stride, int height, - BOOL byteswap, const int *mapping, unsigned int zeropad_mask ) + int src_stride, int dst_stride, int height, BOOL byteswap, + const int *mapping, unsigned int zeropad_mask, unsigned int alpha_bits ) { int x, y, padding_pos = abs(dst_stride) / sizeof(unsigned int) - 1; @@ -1148,7 +1148,7 @@ static void copy_image_byteswap( BITMAPINFO *info, const unsigned char *src, uns case 32: for (y = 0; y < height; y++, src += src_stride, dst += dst_stride) for (x = 0; x < info->bmiHeader.biWidth; x++) - ((ULONG *)dst)[x] = RtlUlongByteSwap( ((const ULONG *)src)[x] ); + ((ULONG *)dst)[x] = RtlUlongByteSwap( ((const ULONG *)src)[x] | alpha_bits ); break; } } @@ -1200,7 +1200,7 @@ DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image, } copy_image_byteswap( info, src, dst, image->bytes_per_line, width_bytes, height, - need_byteswap, mapping, zeropad_mask ); + need_byteswap, mapping, zeropad_mask, 0 ); return ERROR_SUCCESS; } @@ -1565,6 +1565,7 @@ struct x11drv_window_surface RECT bounds; BOOL byteswap; BOOL is_argb; + DWORD alpha_bits; COLORREF color_key; HRGN region; void *bits; @@ -1918,7 +1919,16 @@ static void x11drv_surface_flush( struct window_surface *window_surface ) dst += coords.visrect.top * width_bytes; copy_image_byteswap( &surface->info, src, dst, width_bytes, width_bytes, coords.visrect.bottom - coords.visrect.top, - surface->byteswap, mapping, ~0u ); + surface->byteswap, mapping, ~0u, surface->alpha_bits ); + } + else if (surface->alpha_bits) + { + int x, y, stride = surface->image->bytes_per_line / sizeof(ULONG); + ULONG *ptr = (ULONG *)dst + coords.visrect.top * stride; + + for (y = coords.visrect.top; y < coords.visrect.bottom; y++, ptr += stride) + for (x = coords.visrect.left; x < coords.visrect.right; x++) + ptr[x] |= surface->alpha_bits; } #ifdef HAVE_LIBXXSHM @@ -2033,6 +2043,9 @@ struct window_surface *create_surface( Window window, const XVisualInfo *vis, co XSetSubwindowMode( gdi_display, surface->gc, IncludeInferiors ); surface->byteswap = image_needs_byteswap( surface->image, is_r8g8b8(vis), format->bits_per_pixel ); + if (vis->depth == 32 && !surface->is_argb) + surface->alpha_bits = ~(vis->red_mask | vis->green_mask | vis->blue_mask); + if (surface->byteswap || format->bits_per_pixel == 4 || format->bits_per_pixel == 8) { /* allocate separate surface bits if byte swapping or palette mapping is required */
1
0
0
0
Alexandre Julliard : winex11: Use a separate XRender format for the root window.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: a2a2b5bc885b96748c4e0df5f54a9341b5e8d19c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a2a2b5bc885b96748c4e0df5…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 13:36:21 2018 +0100 winex11: Use a separate XRender format for the root window. When using a custom visual, the default format may not work with the root window. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/xrender.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index cefbd22..b9b7c4f 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -68,6 +68,7 @@ enum wxr_format WXR_FORMAT_B8G8R8A8, WXR_FORMAT_X8R8G8B8, WXR_FORMAT_B8G8R8X8, + WXR_FORMAT_ROOT, /* placeholder for the format to use on the root window */ WXR_NB_FORMATS, WXR_INVALID_FORMAT = WXR_NB_FORMATS }; @@ -273,6 +274,13 @@ static int load_xrender_formats(void) { XRenderPictFormat templ; + if (i == WXR_FORMAT_ROOT) + { + pict_formats[i] = pXRenderFindVisualFormat(gdi_display, + DefaultVisual( gdi_display, DefaultScreen(gdi_display) )); + TRACE( "Loaded root pict_format with id=%#lx\n", pict_formats[i]->id ); + continue; + } if(is_wxrformat_compatible_with_default_visual(&wxr_formats_template[i])) { pict_formats[i] = pXRenderFindVisualFormat(gdi_display, default_visual.visual); @@ -875,6 +883,16 @@ static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, UINT *aa_flags ) return ret; } +static void set_physdev_format( struct xrender_physdev *physdev, enum wxr_format format ) +{ + if (physdev->x11dev->drawable == DefaultRootWindow( gdi_display )) + physdev->format = WXR_FORMAT_ROOT; + else + physdev->format = format; + + physdev->pict_format = pict_formats[physdev->format]; +} + static BOOL create_xrender_dc( PHYSDEV *pdev, enum wxr_format format ) { X11DRV_PDEVICE *x11dev = get_x11drv_dev( *pdev ); @@ -883,8 +901,7 @@ static BOOL create_xrender_dc( PHYSDEV *pdev, enum wxr_format format ) if (!physdev) return FALSE; physdev->x11dev = x11dev; physdev->cache_index = -1; - physdev->format = format; - physdev->pict_format = pict_formats[format]; + set_physdev_format( physdev, format ); push_dc_driver( pdev, &physdev->dev, &xrender_funcs ); return TRUE; } @@ -974,7 +991,11 @@ static INT xrenderdrv_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID if (*(const enum x11drv_escape_codes *)in_data == X11DRV_SET_DRAWABLE) { BOOL ret = dev->funcs->pExtEscape( dev, escape, in_count, in_data, out_count, out_data ); - if (ret) free_xrender_picture( physdev ); /* pict format doesn't change, only drawable */ + if (ret) + { + free_xrender_picture( physdev ); + set_physdev_format( physdev, default_format ); + } return ret; } }
1
0
0
0
Alexandre Julliard : winex11: Use the correct colormap for the OpenGL parent window.
by Alexandre Julliard
26 Jan '18
26 Jan '18
Module: wine Branch: master Commit: d6332e0e57a7206e0caf5cf15b509c1ab4769a40 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d6332e0e57a7206e0caf5cf1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Jan 26 13:35:38 2018 +0100 winex11: Use the correct colormap for the OpenGL parent window. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/opengl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index e976ad7..7401288 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1370,10 +1370,13 @@ static BOOL create_gl_drawable( HWND hwnd, struct gl_drawable *gl ) XSetWindowAttributes attrib; attrib.override_redirect = True; + attrib.border_pixel = 0; if (!dummy_parent) { + attrib.colormap = default_colormap; dummy_parent = XCreateWindow( gdi_display, root_window, -1, -1, 1, 1, 0, default_visual.depth, - InputOutput, default_visual.visual, CWOverrideRedirect, &attrib ); + InputOutput, default_visual.visual, + CWColormap | CWBorderPixel | CWOverrideRedirect, &attrib ); XMapWindow( gdi_display, dummy_parent ); } gl->colormap = XCreateColormap(gdi_display, dummy_parent, gl->visual->visual, @@ -1388,7 +1391,7 @@ static BOOL create_gl_drawable( HWND hwnd, struct gl_drawable *gl ) gl->window = XCreateWindow( gdi_display, dummy_parent, 0, 0, gl->rect.right - gl->rect.left, gl->rect.bottom - gl->rect.top, 0, gl->visual->depth, InputOutput, gl->visual->visual, - CWColormap | CWOverrideRedirect, &attrib ); + CWColormap | CWBorderPixel | CWOverrideRedirect, &attrib ); if (gl->window) { gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL );
1
0
0
0
Nikolay Sivov : comctl32/tests: Reload library before starting version 6 tests.
by Alexandre Julliard
25 Jan '18
25 Jan '18
Module: wine Branch: master Commit: f54a6617673d8fea6c2a3a2fa805fa906de82198 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f54a6617673d8fea6c2a3a2f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 25 17:23:18 2018 +0300 comctl32/tests: Reload library before starting version 6 tests. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/treeview.c | 11 ----------- dlls/comctl32/tests/v6util.h | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index 51404af..64fb1eb 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -1342,9 +1342,6 @@ static LRESULT CALLBACK parent_wnd_proc(HWND hWnd, UINT message, WPARAM wParam, break; } - case WM_DESTROY: - PostQuitMessage(0); - break; } defwndproc_counter++; @@ -2682,7 +2679,6 @@ START_TEST(treeview) ULONG_PTR ctx_cookie; HANDLE hCtx; WNDCLASSA wc; - MSG msg; init_functions(); @@ -2760,11 +2756,4 @@ START_TEST(treeview) test_WM_GETDLGCODE(); unload_v6_module(ctx_cookie, hCtx); - - PostMessageA(hMainWnd, WM_CLOSE, 0, 0); - while(GetMessageA(&msg, 0, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessageA(&msg); - } } diff --git a/dlls/comctl32/tests/v6util.h b/dlls/comctl32/tests/v6util.h index b78290a..626f6e6 100644 --- a/dlls/comctl32/tests/v6util.h +++ b/dlls/comctl32/tests/v6util.h @@ -70,6 +70,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) { ACTCTX_SECTION_KEYED_DATA data; DWORD written; + HMODULE hmod; ACTCTXA ctx; HANDLE file; BOOL ret; @@ -103,6 +104,8 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) *hCtx = CreateActCtxA(&ctx); ok(*hCtx != 0, "Expected context handle\n"); + hmod = GetModuleHandleA("comctl32.dll"); + ret = ActivateActCtx(*hCtx, pcookie); ok(ret, "Failed to activate context, error %d.\n", GetLastError()); @@ -117,7 +120,10 @@ static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) "comctl32.dll", &data); ok(ret, "failed to find comctl32.dll in active context, %u\n", GetLastError()); if (ret) + { + FreeLibrary(hmod); LoadLibraryA("comctl32.dll"); + } return ret; }
1
0
0
0
Nikolay Sivov : comctl32/tests: Remove some test sequences that are not interesting.
by Alexandre Julliard
25 Jan '18
25 Jan '18
Module: wine Branch: master Commit: d41f22bb32a9faa9fa5b5557c7e695e9233e9fa4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d41f22bb32a9faa9fa5b5557…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 25 17:23:17 2018 +0300 comctl32/tests: Remove some test sequences that are not interesting. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tab.c | 157 +++++++--------------------------------------- 1 file changed, 24 insertions(+), 133 deletions(-) diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index aa411b5..a54dbb5 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -83,81 +83,15 @@ static LRESULT tcn_selchanging_result; static struct msg_sequence *sequences[NUM_MSG_SEQUENCES]; -static const struct message add_tab_to_parent[] = { - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent|optional }, - { WM_NOTIFYFORMAT, sent|defwinproc }, - { WM_QUERYUISTATE, sent|wparam|lparam|defwinproc|optional, 0, 0 }, - { WM_PARENTNOTIFY, sent|defwinproc }, - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent|optional }, - { 0 } -}; - -static const struct message add_tab_to_parent_interactive[] = { - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent }, - { WM_NOTIFYFORMAT, sent|defwinproc }, - { WM_QUERYUISTATE, sent|wparam|lparam|defwinproc, 0, 0 }, - { WM_PARENTNOTIFY, sent|defwinproc }, - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent }, - { TCM_INSERTITEMA, sent }, - { WM_SHOWWINDOW, sent}, - { WM_WINDOWPOSCHANGING, sent}, - { WM_WINDOWPOSCHANGING, sent}, - { WM_NCACTIVATE, sent}, - { WM_ACTIVATE, sent}, - { WM_IME_SETCONTEXT, sent|defwinproc|optional}, - { WM_IME_NOTIFY, sent|defwinproc|optional}, - { WM_SETFOCUS, sent|defwinproc}, - { WM_WINDOWPOSCHANGED, sent}, - { WM_SIZE, sent}, - { WM_MOVE, sent}, - { 0 } -}; - -static const struct message add_tab_control_parent_seq[] = { - { WM_NOTIFYFORMAT, sent }, - { WM_QUERYUISTATE, sent|wparam|lparam|optional, 0, 0 }, - { 0 } -}; - -static const struct message add_tab_control_parent_seq_interactive[] = { - { WM_NOTIFYFORMAT, sent }, - { WM_QUERYUISTATE, sent|wparam|lparam, 0, 0 }, - { WM_WINDOWPOSCHANGING, sent|optional}, - { WM_NCACTIVATE, sent}, - { WM_ACTIVATE, sent}, - { WM_WINDOWPOSCHANGING, sent|optional}, - { WM_KILLFOCUS, sent}, - { WM_IME_SETCONTEXT, sent|optional}, - { WM_IME_NOTIFY, sent|optional}, - { 0 } -}; - static const struct message empty_sequence[] = { { 0 } }; -static const struct message get_item_count_seq[] = { - { TCM_GETITEMCOUNT, sent|wparam|lparam, 0, 0 }, - { 0 } -}; - static const struct message get_row_count_seq[] = { { TCM_GETROWCOUNT, sent|wparam|lparam, 0, 0 }, { 0 } }; -static const struct message get_item_rect_seq[] = { - { TCM_GETITEMRECT, sent }, - { TCM_GETITEMRECT, sent }, - { 0 } -}; - static const struct message getset_cur_focus_seq[] = { { TCM_SETCURFOCUS, sent|lparam, 0 }, { TCM_GETCURFOCUS, sent|wparam|lparam, 0, 0 }, @@ -1002,68 +936,6 @@ static void test_getset_tooltips(void) DestroyWindow(toolTip); } -static void test_misc(void) -{ - const INT nTabs = 5; - HWND hTab; - RECT rTab; - INT nTabsRetrieved; - INT rowCount; - INT dpi; - HDC hdc; - - ok(parent_wnd != NULL, "no parent window!\n"); - flush_sequences(sequences, NUM_MSG_SEQUENCES); - - hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, nTabs); - ok(hTab != NULL, "Failed to create tab control\n"); - - if(!winetest_interactive) - ok_sequence(sequences, TAB_SEQ_INDEX, add_tab_to_parent, - "Tab sequence, after adding tab control to parent", TRUE); - else - ok_sequence(sequences, TAB_SEQ_INDEX, add_tab_to_parent_interactive, - "Tab sequence, after adding tab control to parent", TRUE); - - if(!winetest_interactive) - ok_sequence(sequences, PARENT_SEQ_INDEX, add_tab_control_parent_seq, - "Parent after sequence, adding tab control to parent", TRUE); - else - ok_sequence(sequences, PARENT_SEQ_INDEX, add_tab_control_parent_seq_interactive, - "Parent after sequence, adding tab control to parent", TRUE); - - flush_sequences(sequences, NUM_MSG_SEQUENCES); - ok(SendMessageA(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0, "TCM_SETMINTABWIDTH returned < 0\n"); - ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE); - - /* Testing GetItemCount */ - flush_sequences(sequences, NUM_MSG_SEQUENCES); - nTabsRetrieved = SendMessageA(hTab, TCM_GETITEMCOUNT, 0, 0); - expect(nTabs, nTabsRetrieved); - ok_sequence(sequences, TAB_SEQ_INDEX, get_item_count_seq, "Get itemCount test sequence", FALSE); - ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Getset itemCount test parent sequence", FALSE); - - /* Testing GetRowCount */ - flush_sequences(sequences, NUM_MSG_SEQUENCES); - rowCount = SendMessageA(hTab, TCM_GETROWCOUNT, 0, 0); - expect(1, rowCount); - ok_sequence(sequences, TAB_SEQ_INDEX, get_row_count_seq, "Get rowCount test sequence", FALSE); - ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Get rowCount test parent sequence", FALSE); - - /* Testing GetItemRect */ - flush_sequences(sequences, NUM_MSG_SEQUENCES); - ok(SendMessageA(hTab, TCM_GETITEMRECT, 0, (LPARAM)&rTab), "GetItemRect failed.\n"); - - hdc = GetDC(hTab); - dpi = GetDeviceCaps(hdc, LOGPIXELSX); - ReleaseDC(hTab, hdc); - CHECKSIZE(hTab, dpi, -1 , "Default Width"); - ok_sequence(sequences, TAB_SEQ_INDEX, get_item_rect_seq, "Get itemRect test sequence", FALSE); - ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Get itemRect test parent sequence", FALSE); - - DestroyWindow(hTab); -} - static void test_adjustrect(void) { HWND hTab; @@ -1543,6 +1415,28 @@ todo_wine DestroyWindow(hTab); } +static void test_TCM_GETROWCOUNT(void) +{ + const INT nTabs = 5; + HWND hTab; + INT count; + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, nTabs); + ok(hTab != NULL, "Failed to create tab control\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + + count = SendMessageA(hTab, TCM_GETROWCOUNT, 0, 0); + ok(count == 1, "Unexpected row count %d.\n", count); + + ok_sequence(sequences, TAB_SEQ_INDEX, get_row_count_seq, "Get rowCount test sequence", FALSE); + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Get rowCount test parent sequence", FALSE); + + DestroyWindow(hTab); +} + START_TEST(tab) { LOGFONTA logfont; @@ -1556,23 +1450,19 @@ START_TEST(tab) init_functions(); - test_width(); - init_msg_sequences(sequences, NUM_MSG_SEQUENCES); parent_wnd = createParentWindow(); ok(parent_wnd != NULL, "Failed to create parent window!\n"); + test_width(); test_curfocus(); test_cursel(); test_extendedstyle(); test_unicodeformat(); test_getset_item(); test_getset_tooltips(); - test_misc(); - test_adjustrect(); - test_insert_focus(); test_delete_focus(); test_delete_selection(); @@ -1582,6 +1472,7 @@ START_TEST(tab) test_WM_CONTEXTMENU(); test_create(); test_TCN_SELCHANGING(); + test_TCM_GETROWCOUNT(); DestroyWindow(parent_wnd); }
1
0
0
0
Nikolay Sivov : comctl32/tests: Extend TCM_SETTOOLTIPS test.
by Alexandre Julliard
25 Jan '18
25 Jan '18
Module: wine Branch: master Commit: 37052ad9c1dc274dd0dfdaa1d0002160a93eb7cc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37052ad9c1dc274dd0dfdaa1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 25 17:23:16 2018 +0300 comctl32/tests: Extend TCM_SETTOOLTIPS test. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tab.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index 8a55553..aa411b5 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -974,8 +974,9 @@ static void test_getset_item(void) static void test_getset_tooltips(void) { char toolTipText[32] = "ToolTip Text Test"; + HWND hTab, toolTip, hwnd; const INT nTabs = 5; - HWND hTab, toolTip; + int ret; hTab = createFilledTabControl(parent_wnd, TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE, nTabs); ok(hTab != NULL, "Failed to create tab control\n"); @@ -983,16 +984,22 @@ static void test_getset_tooltips(void) flush_sequences(sequences, NUM_MSG_SEQUENCES); toolTip = create_tooltip(hTab, toolTipText); - SendMessageA(hTab, TCM_SETTOOLTIPS, (LPARAM)toolTip, 0); - ok(toolTip == (HWND)SendMessageA(hTab, TCM_GETTOOLTIPS, 0,0), "ToolTip was set incorrectly.\n"); + ret = SendMessageA(hTab, TCM_SETTOOLTIPS, (WPARAM)toolTip, 0); + ok(ret == 0, "Unexpected ret value %d.\n", ret); + hwnd = (HWND)SendMessageA(hTab, TCM_GETTOOLTIPS, 0, 0); + ok(toolTip == hwnd, "Unexpected tooltip window.\n"); - SendMessageA(hTab, TCM_SETTOOLTIPS, 0, 0); - ok(!SendMessageA(hTab, TCM_GETTOOLTIPS, 0,0), "ToolTip was set incorrectly.\n"); + ret = SendMessageA(hTab, TCM_SETTOOLTIPS, 0, 0); + ok(ret == 0, "Unexpected ret value %d.\n", ret); + hwnd = (HWND)SendMessageA(hTab, TCM_GETTOOLTIPS, 0, 0); + ok(hwnd == NULL, "Unexpected tooltip window.\n"); + ok(IsWindow(toolTip), "Expected tooltip window to be alive.\n"); ok_sequence(sequences, TAB_SEQ_INDEX, getset_tooltip_seq, "Getset tooltip test sequence", TRUE); ok_sequence(sequences, PARENT_SEQ_INDEX, getset_tooltip_parent_seq, "Getset tooltip test parent sequence", TRUE); DestroyWindow(hTab); + DestroyWindow(toolTip); } static void test_misc(void)
1
0
0
0
Nikolay Sivov : comctl32/tests: Use better names for test window procedures.
by Alexandre Julliard
25 Jan '18
25 Jan '18
Module: wine Branch: master Commit: 7b304a9ddda9198dd21e765a5ec70a47568acba6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b304a9ddda9198dd21e765a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 25 17:23:15 2018 +0300 comctl32/tests: Use better names for test window procedures. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/tab.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/tests/tab.c b/dlls/comctl32/tests/tab.c index 9823915..8a55553 100644 --- a/dlls/comctl32/tests/tab.c +++ b/dlls/comctl32/tests/tab.c @@ -319,7 +319,7 @@ create_tabcontrol (DWORD style, DWORD mask) return handle; } -static LRESULT WINAPI parentWindowProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { static LONG defwndproc_counter = 0; struct message msg = { 0 }; @@ -367,7 +367,7 @@ static BOOL registerParentWindowClass(void) WNDCLASSA cls; cls.style = 0; - cls.lpfnWndProc = parentWindowProcess; + cls.lpfnWndProc = parent_wnd_proc; cls.cbClsExtra = 0; cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(NULL); @@ -389,7 +389,7 @@ static HWND createParentWindow(void) GetDesktopWindow(), NULL, GetModuleHandleA(NULL), NULL); } -static LRESULT WINAPI tabSubclassProcess(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +static LRESULT WINAPI tab_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA); static LONG defwndproc_counter = 0; @@ -435,7 +435,7 @@ static HWND createFilledTabControl(HWND parent_wnd, DWORD style, DWORD mask, INT rect.bottom, parent_wnd, NULL, NULL, 0); ok(tabHandle != NULL, "failed to create tab wnd\n"); - oldproc = (WNDPROC)SetWindowLongPtrA(tabHandle, GWLP_WNDPROC, (LONG_PTR)tabSubclassProcess); + oldproc = (WNDPROC)SetWindowLongPtrA(tabHandle, GWLP_WNDPROC, (LONG_PTR)tab_subclass_proc); SetWindowLongPtrA(tabHandle, GWLP_USERDATA, (LONG_PTR)oldproc); tcNewTab.mask = mask;
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
64
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
Results per page:
10
25
50
100
200