[PATCH v2] winex11.drv: Handle Vulkan surface creation with NULL hwnd.

Rémi Bernon rbernon at codeweavers.com
Mon May 3 04:52:05 CDT 2021


On 5/3/21 11:45 AM, Paul Gofman wrote:
> On 5/1/21 10:21, Rémi Bernon wrote:
>> A few style nitpicks, otherwise it looks good to me.
>>
>> On 4/30/21 4:42 PM, Paul Gofman wrote:
>>> @@ -292,8 +297,10 @@ static VkResult
>>> X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance,
>>>            return VK_ERROR_OUT_OF_HOST_MEMORY;
>>>          x11_surface->ref = 1;
>>> +    x11_surface->hwnd = create_info->hwnd;
>>> +    x11_surface->window = x11_surface->hwnd ?
>>> create_client_window(create_info->hwnd, &default_visual)
>>> +            : create_dummy_client_window();
>>
>> Indentation feels weird here, I think it would be better if ':' was
>> aligned with the '?' above.
> 
> Yeah, ok, I will change this way.
> 
> 
>>
>>>
>>>    diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
>>> index baaa30d74e3..1f0d636a142 100644
>>> --- a/dlls/winex11.drv/window.c
>>> +++ b/dlls/winex11.drv/window.c
>>> @@ -1466,6 +1466,26 @@ static Window get_dummy_parent(void)
>>>    }
>>>     
>>> +/**********************************************************************
>>> + *        create_dummy_window
>>
>> Should probably be create_dummy_client_window
>>
> Thanks, that's a copy-paste leftover.
> 
> 
>>> + */
>>> +Window create_dummy_client_window(void)
>>> +{
>>> +    XSetWindowAttributes attr;
>>> +
>>> +    attr.colormap = default_colormap;
>>> +    attr.bit_gravity = NorthWestGravity;
>>> +    attr.win_gravity = NorthWestGravity;
>>> +    attr.backing_store = NotUseful;
>>> +    attr.border_pixel = 0;
>>> +
>>> +    return XCreateWindow( gdi_display,
>>> +                                       get_dummy_parent(),
>>> +                                       0, 0, 1, 1, 0,
>>> default_visual.depth, InputOutput,
>>> +                                       default_visual.visual,
>>> CWBitGravity | CWWinGravity |
>>> +                                       CWBackingStore | CWColormap |
>>> CWBorderPixel, &attr );
>>
>> Here as well, indentation is pretty weird.
> 
> The indentation is actually a copy paste from XCrreateWindow in
> create_client_window(). I agree its weird though. I realized I am
> missing the general rule for multipline operator indentation if it is
> not wined3d style used. Do you know if there is such a rule?
> 

No idea, I think winex11 is a bit messy but except for some parts I 
think it tends to follow Julliard style (as ntdll for instance), with 
line continuations aligned with the corresponding element on the 
previous line.

This probably could be something like IMHO:

>     return XCreateWindow( gdi_display, get_dummy_parent(), 0, 0, 1, 1, 0,
>                           default_visual.depth, InputOutput, default_visual.visual,
>                           CWBitGravity | CWWinGravity | CWBackingStore | CWColormap | CWBorderPixel, &attr );

Cheers,
-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list