@rbernon, I could use some advice on this.
I believe this has been broken since 31b9d0c0cc67b3a03340c33f0e9942bee94c431b--unfortunately I don't have a standalone test app for it, but when display mode emulation is enabled, games like Half-Life 2 display correctly on launch but do not display correctly after the (full)screen resolution is changed in-game.
The fix here does work, but it's maybe not correct to call `make_context_current()` in the `client_surface_update`? I found that in the case of the view position check in `macdrv_client_surface_update`, win32u calls `make_context_current` afterwards. This isn't the case when the DPI has changed though, requiring that explicit `make_context_current` call. Also previously this check was done in `macdrv_swap_buffers` and it could be done now in `macdrv_surface_swap`, but it seems preferable to do things in `update` rather than `swap` if possible.
And !8504 changes all of this, where should it go in that case?
From: Brendan Shanks bshanks@codeweavers.com
--- dlls/winemac.drv/opengl.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/winemac.drv/opengl.c b/dlls/winemac.drv/opengl.c index 172b0d60226..1fff143ac29 100644 --- a/dlls/winemac.drv/opengl.c +++ b/dlls/winemac.drv/opengl.c @@ -2953,6 +2953,27 @@ static void macdrv_client_surface_update(struct client_surface *client) { TRACE("GL view %p changed position; marking contexts\n", data->client_cocoa_view); mark_contexts_for_moved_view(data->client_cocoa_view); + + { + struct macdrv_context *context; + + pthread_mutex_lock(&context_mutex); + LIST_FOR_EACH_ENTRY(context, &context_list, struct macdrv_context, entry) + { + if (context->draw_view == data->client_cocoa_view) + { + RECT rect; + NtUserGetClientRect(context->draw_hwnd, &rect, NtUserGetDpiForWindow(context->draw_hwnd)); + if (!EqualRect(&context->draw_rect_win_dpi, &rect)) + { + ERR("GL view %p context %p rect %s -> %s\n", data->client_cocoa_view, context, wine_dbgstr_rect(&context->draw_rect_win_dpi), wine_dbgstr_rect(&rect)); + //context->draw_rect_win_dpi = rect; + make_context_current(context, FALSE); + } + } + } + pthread_mutex_unlock(&context_mutex); + } }
release_win_data(data);
Hmm... I'm not seeing any issue with wglgears and `wine control desk.cpl` virtual resolution changes, so I'm not sure what needs to be done.
Nevertheless, I added a https://gitlab.winehq.org/wine/wine/-/merge_requests/8504/diffs?commit_id=db... and https://gitlab.winehq.org/wine/wine/-/merge_requests/8504/diffs?commit_id=0e... to !8504 which I believe could be doing what you want?
On Mon Aug 4 19:04:39 2025 +0000, Rémi Bernon wrote:
Hmm... I'm not seeing any issue with wglgears and `wine control desk.cpl` virtual resolution changes, so I'm not sure what needs to be done. Nevertheless, I added a https://gitlab.winehq.org/wine/wine/-/merge_requests/8504/diffs?commit_id=db... and https://gitlab.winehq.org/wine/wine/-/merge_requests/8504/diffs?commit_id=0e... to !8504 which I believe could be doing what you want?
Thanks, tested with Half-Life 2 + wined3d and those commits fix the issue.
This merge request was closed by Brendan Shanks.