[PATCH 1/2] wined3d: Allow creating swapchains for windows with empty client rect.

Józef Kucia jkucia at codeweavers.com
Thu May 17 08:46:54 CDT 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/wined3d/swapchain.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index ea93212a24f9..7a3f1ff95e90 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -796,15 +796,16 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
     GetClientRect(window, &client_rect);
     if (desc->windowed)
     {
+        TRACE("Client rect %s.\n", wine_dbgstr_rect(&client_rect));
+
         if (!desc->backbuffer_width)
         {
-            desc->backbuffer_width = client_rect.right;
+            desc->backbuffer_width = client_rect.right ? client_rect.right : 8;
             TRACE("Updating width to %u.\n", desc->backbuffer_width);
         }
-
         if (!desc->backbuffer_height)
         {
-            desc->backbuffer_height = client_rect.bottom;
+            desc->backbuffer_height = client_rect.bottom ? client_rect.bottom : 8;
             TRACE("Updating height to %u.\n", desc->backbuffer_height);
         }
 
-- 
2.16.1




More information about the wine-devel mailing list