winex11: Default to an ARGB visual when depth is set to 32.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-01-26 13:39:22 +01:00
parent e40ff92e7c
commit 31c7a7157d
1 changed files with 20 additions and 16 deletions

View File

@ -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 );
}