Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56811 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56989
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/sysparams.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index edf1a705168..e1176b381a2 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -616,7 +616,7 @@ static unsigned int query_reg_subkey_value( HKEY hkey, const char *name, KEY_VAL return size; }
-static BOOL reade_source_from_registry( unsigned int index, struct source *source, char *gpu_path ) +static BOOL read_source_from_registry( unsigned int index, struct source *source, char *gpu_path ) { char buffer[4096]; KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; @@ -1738,7 +1738,7 @@ static BOOL update_display_cache_from_registry(void) source->refcount = 1; source->id = source_id;
- if (!reade_source_from_registry( source_id, source, path ) || + if (!read_source_from_registry( source_id, source, path ) || !(source->gpu = find_gpu_from_path( path ))) { free( source->modes );
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56811 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56989 --- dlls/win32u/sysparams.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index e1176b381a2..afa75928c94 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -934,6 +934,7 @@ struct device_manager_ctx struct source source; HKEY source_key; struct list vulkan_gpus; + BOOL has_primary; /* for the virtual desktop settings */ BOOL is_primary; DEVMODEW primary; @@ -1366,8 +1367,13 @@ static void add_source( const char *name, UINT state_flags, void *param )
memset( &ctx->source, 0, sizeof(ctx->source) ); ctx->source.gpu = &ctx->gpu; - ctx->source.id = ctx->source_count; + ctx->source.id = ctx->source_count + (ctx->has_primary ? 0 : 1); ctx->source.state_flags = state_flags; + if (state_flags & DISPLAY_DEVICE_PRIMARY_DEVICE) + { + ctx->source.id = 0; + ctx->has_primary = TRUE; + }
/* Wine specific config key where source settings will be held, symlinked with the logically indexed config key */ snprintf( ctx->source.path, sizeof(ctx->source.path), "%s\%s\Video\%s\Sources\%s", config_keyA, @@ -1941,12 +1947,18 @@ static BOOL add_virtual_source( struct device_manager_ctx *ctx ) DEVMODEW current = {.dmSize = sizeof(current)}, initial = ctx->primary, maximum = ctx->primary; struct source virtual_source = { - .state_flags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE | DISPLAY_DEVICE_VGA_COMPATIBLE, - .id = ctx->source_count, + .state_flags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_VGA_COMPATIBLE, .gpu = &ctx->gpu, }; struct gdi_monitor monitor = {0};
+ if (ctx->has_primary) ctx->source.id = ctx->source_count; + else + { + virtual_source.state_flags |= DISPLAY_DEVICE_PRIMARY_DEVICE; + ctx->has_primary = TRUE; + } + /* Wine specific config key where source settings will be held, symlinked with the logically indexed config key */ snprintf( virtual_source.path, sizeof(virtual_source.path), "%s\%s\Video\%s\Sources\%s", config_keyA, control_keyA + strlen( "\Registry\Machine" ), virtual_source.gpu->guid, "Virtual" );