Commit aadae4d1 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

winex11.drv: Report a GPU same as the host primary GPU in virtual desktop mode.

parent 41acd014
...@@ -212,7 +212,12 @@ static BOOL X11DRV_desktop_get_gpus( struct x11drv_gpu **new_gpus, int *count ) ...@@ -212,7 +212,12 @@ static BOOL X11DRV_desktop_get_gpus( struct x11drv_gpu **new_gpus, int *count )
gpu = heap_calloc( 1, sizeof(*gpu) ); gpu = heap_calloc( 1, sizeof(*gpu) );
if (!gpu) return FALSE; if (!gpu) return FALSE;
if (!get_host_primary_gpu( gpu ))
{
WARN( "Failed to get host primary gpu.\n" );
lstrcpyW( gpu->name, wine_adapterW ); lstrcpyW( gpu->name, wine_adapterW );
}
*new_gpus = gpu; *new_gpus = gpu;
*count = 1; *count = 1;
return TRUE; return TRUE;
......
...@@ -259,6 +259,21 @@ RECT get_host_primary_monitor_rect(void) ...@@ -259,6 +259,21 @@ RECT get_host_primary_monitor_rect(void)
return rect; return rect;
} }
BOOL get_host_primary_gpu(struct x11drv_gpu *gpu)
{
struct x11drv_gpu *gpus;
INT gpu_count;
if (host_handler.get_gpus(&gpus, &gpu_count) && gpu_count)
{
*gpu = gpus[0];
host_handler.free_gpus(gpus);
return TRUE;
}
return FALSE;
}
RECT get_work_area(const RECT *monitor_rect) RECT get_work_area(const RECT *monitor_rect)
{ {
Atom type; Atom type;
......
...@@ -792,6 +792,7 @@ struct x11drv_display_device_handler ...@@ -792,6 +792,7 @@ struct x11drv_display_device_handler
}; };
extern HANDLE get_display_device_init_mutex(void) DECLSPEC_HIDDEN; extern HANDLE get_display_device_init_mutex(void) DECLSPEC_HIDDEN;
extern BOOL get_host_primary_gpu(struct x11drv_gpu *gpu) DECLSPEC_HIDDEN;
extern void release_display_device_init_mutex(HANDLE) DECLSPEC_HIDDEN; extern void release_display_device_init_mutex(HANDLE) DECLSPEC_HIDDEN;
extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_SetHandler(const struct x11drv_display_device_handler *handler) DECLSPEC_HIDDEN;
extern void X11DRV_DisplayDevices_Init(BOOL force) DECLSPEC_HIDDEN; extern void X11DRV_DisplayDevices_Init(BOOL force) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment