 
            Since 7b28c6d17c7da278307756cfcd0da830e5d39baf, we directly use `NtUserGetClientRect` to get the size of the GL target windows. But that returns an empty rect for minimized windows, and attempting to set a zero size on a CGL context in `-[WineOpenGLContext wine_updateBackingSize:]` causes a Metal assertion. You can see this by minimizing e.g. Geometry Dash or Garry's Mod.
We could just not call wine_updateBackingSize if we find a zero dimension for the window, but I think we want to attempt to keep the backing size correct. Perhaps there's a better way to get the client rect of a minimized window than the un-AdjustWindowRect approach I'm using here? If the window is minimized fullscreen, `get_win_data(hwnd)->rects.client` is (-32000, -32000) - (-32000, -32000).
-- v2: winemac.drv: Never set a zero backing size for a GL context.
 
            From: Tim Clem tclem@codeweavers.com
Doing so results in a Metal assertion on newer OSes. --- dlls/winemac.drv/cocoa_opengl.m | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/winemac.drv/cocoa_opengl.m b/dlls/winemac.drv/cocoa_opengl.m index ea00f95ff68..3e5f682613a 100644 --- a/dlls/winemac.drv/cocoa_opengl.m +++ b/dlls/winemac.drv/cocoa_opengl.m @@ -94,12 +94,16 @@ - (void) resetSurfaceIfBackingSizeChanged } }
+ /* This is a no-op if either dimension of the size is zero. */ - (void) wine_updateBackingSize:(const CGSize*)size { GLint enabled;
if (size) { + if (size->width == 0 || size->height == 0) + return; + if (CGLIsEnabled(self.CGLContextObj, kCGLCESurfaceBackingSize, &enabled) != kCGLNoError) enabled = 0;
 
            On Tue Oct 21 17:54:50 2025 +0000, Tim Clem wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/9049/diffs?diff_id=217735&start_sha=3411fc2341ecba4e5055303fdcd32e4b581727a2#48a77986a23ba0487a55fe19f8c10724b23be502_1530_1492)
Since that sounds like a broader change, I've updated this MR to just reject 0-dimension backing sizes, which we should absolutely never attempt to set. Does that seem like a good step for now?
 
            On Tue Oct 21 17:55:41 2025 +0000, Tim Clem wrote:
Since that sounds like a broader change, I've updated this MR to just reject 0-dimension backing sizes, which we should absolutely never attempt to set. Does that seem like a good step for now?
Seems reasonable to me.
 
            This merge request was approved by Rémi Bernon.
 
            This merge request was approved by Brendan Shanks.



