From b55593cb4cbeb4d2eb9ecd5e3087a76b61e481e6 Mon Sep 17 00:00:00 2001
From: FunkyFr3sh <cc.red.alert.1@googlemail.com>
Date: Tue, 21 May 2024 06:55:23 +0200
Subject: [PATCH] #311 fix fullscreen issues with opengl/gdi in nancy drew
 games

---
 src/dd.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/dd.c b/src/dd.c
index bd54438..c8fa433 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -916,6 +916,13 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
             real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_TOOLWINDOW));
         }
 
+        exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
+
+        if ((exstyle & WS_EX_CLIENTEDGE))
+        {
+            real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
+        }
+
         if (IsWine())
         {
             real_SetWindowLongA(
@@ -1019,6 +1026,13 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
             real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_TOOLWINDOW));
         }
 
+        exstyle = real_GetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE);
+
+        if ((exstyle & WS_EX_CLIENTEDGE))
+        {
+            real_SetWindowLongA(g_ddraw.hwnd, GWL_EXSTYLE, exstyle & ~(WS_EX_CLIENTEDGE));
+        }
+
         BOOL d3d9_active = FALSE;
 
         if (g_ddraw.renderer == d3d9_render_main)