Module: wine Branch: master Commit: 83b1d167bd4cf10e9a7b4a7c91b3a2d1e9621d89 URL: https://gitlab.winehq.org/wine/wine/-/commit/83b1d167bd4cf10e9a7b4a7c91b3a2d...
Author: Alexandros Frantzis alexandros.frantzis@collabora.com Date: Wed Apr 5 20:10:35 2023 +0300
winex11.drv: Do not call desktop get_current_mode() from UpdateDisplayDevices.
We don't need to set the win32u current mode when we are in virtual desktop mode, and, additionally, skipping this avoids a deadlock, since the virtual desktop get_current_mode() implementation recurses into win32u.
Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com Fixes: 4232312dffe1cd115aa6bfd755f5b7c6a403e3fc Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54781
---
dlls/winex11.drv/display.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 75b585ff201..c75977002ef 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -542,10 +542,12 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage INT gpu, adapter, monitor; DEVMODEW *modes, *mode; UINT mode_count; + BOOL virtual_desktop;
if (!force && !force_display_devices_refresh) return TRUE; force_display_devices_refresh = FALSE; - handler = is_virtual_desktop() ? &desktop_handler : &host_handler; + virtual_desktop = is_virtual_desktop(); + handler = virtual_desktop ? &desktop_handler : &host_handler;
TRACE("via %s\n", wine_dbgstr_a(handler->name));
@@ -585,7 +587,11 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage asciiz_to_unicode( devname, buffer ); if (!settings_handler.get_id( devname, is_primary, &settings_id )) break;
- settings_handler.get_current_mode( settings_id, ¤t_mode ); + /* We don't need to set the win32u current mode when we are in + * virtual desktop mode, and, additionally, skipping this avoids a + * deadlock, since the desktop get_current_mode() implementation + * recurses into win32u. */ + if (!virtual_desktop) settings_handler.get_current_mode( settings_id, ¤t_mode ); if (!settings_handler.get_modes( settings_id, EDS_ROTATEDMODE, &modes, &mode_count )) continue;