Module: wine Branch: master Commit: 6bc1eea7182acdcdfc74c04bbfbd8710818e5b9a URL: https://gitlab.winehq.org/wine/wine/-/commit/6bc1eea7182acdcdfc74c04bbfbd871...
Author: Paul Gofman pgofman@codeweavers.com Date: Mon Feb 13 15:11:25 2023 -0600
win32u: Remove monitor name from gdi driver monitor info.
---
dlls/win32u/sysparams.c | 8 +++----- dlls/winemac.drv/cocoa_display.m | 1 - dlls/winemac.drv/display.c | 3 --- dlls/winemac.drv/macdrv_cocoa.h | 2 -- dlls/winex11.drv/desktop.c | 4 ---- dlls/winex11.drv/display.c | 3 --- dlls/winex11.drv/xinerama.c | 4 ---- dlls/winex11.drv/xrandr.c | 7 ------- include/wine/gdi_driver.h | 1 - 9 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 2269193b7ff..aab148bbfe3 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1311,12 +1311,11 @@ static void add_monitor( const struct gdi_monitor *monitor, void *param ) static const WCHAR default_monitorW[] = {'M','O','N','I','T','O','R','\','D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0};
- TRACE( "%s %s %s\n", debugstr_w(monitor->name), wine_dbgstr_rect(&monitor->rc_monitor), - wine_dbgstr_rect(&monitor->rc_work) ); - monitor_index = ctx->monitor_count++; output_index = ctx->output_count++;
+ TRACE( "%u %s %s\n", monitor_index, wine_dbgstr_rect(&monitor->rc_monitor), wine_dbgstr_rect(&monitor->rc_work) ); + sprintf( buffer, "MonitorID%u", monitor_index ); sprintf( instance, "DISPLAY\Default_Monitor\%04X&%04X", ctx->video_count - 1, monitor_index ); set_reg_ascii_value( ctx->adapter_key, buffer, instance ); @@ -1327,8 +1326,7 @@ static void add_monitor( const struct gdi_monitor *monitor, void *param )
link_device( bufferW, guid_devinterface_monitorW );
- lstrcpyW( bufferW, monitor->name ); - if (!bufferW[0]) asciiz_to_unicode( bufferW, "Generic Non-PnP Monitor" ); + asciiz_to_unicode( bufferW, "Generic Non-PnP Monitor" ); set_reg_value( hkey, device_descW, REG_SZ, bufferW, (lstrlenW( bufferW ) + 1) * sizeof(WCHAR) );
set_reg_value( hkey, classW, REG_SZ, monitorW, sizeof(monitorW) ); diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m index 04f6dda4481..b5096a39ca4 100644 --- a/dlls/winemac.drv/cocoa_display.m +++ b/dlls/winemac.drv/cocoa_display.m @@ -675,7 +675,6 @@ int macdrv_get_monitors(uint32_t adapter_id, struct macdrv_monitor** new_monitor if (j == 0) primary_index = monitor_count;
- strcpy(monitors[monitor_count].name, "Generic Non-PnP Monitor"); monitors[monitor_count].state_flags = DISPLAY_DEVICE_ATTACHED | DISPLAY_DEVICE_ACTIVE; monitors[monitor_count].rc_monitor = displays[j].frame; monitors[monitor_count].rc_work = displays[j].work_frame; diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index dab81cc8ffb..19ff72a7130 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -1192,9 +1192,6 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage .rc_work = rect_from_cgrect(monitor->rc_work), .state_flags = monitor->state_flags, }; - RtlUTF8ToUnicodeN(gdi_monitor.name, sizeof(gdi_monitor.name), &len, - monitor->name, strlen(monitor->name)); - TRACE("monitor: %s\n", debugstr_a(monitor->name)); device_manager->add_monitor( &gdi_monitor, param ); }
diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index 6196032c08d..a82dd319330 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -291,8 +291,6 @@ struct macdrv_adapter /* Represent a monitor in EnumDisplayDevices context */ struct macdrv_monitor { - /* Name, in UTF-8 encoding */ - char name[128]; /* as RcMonitor in MONITORINFO struct after conversion by rect_from_cgrect */ CGRect rc_monitor; /* as RcWork in MONITORINFO struct after conversion by rect_from_cgrect */ diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index bb998543ae7..a0367d6ce50 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -287,15 +287,11 @@ static void X11DRV_desktop_free_adapters( struct gdi_adapter *adapters )
static BOOL X11DRV_desktop_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **new_monitors, int *count ) { - static const WCHAR generic_nonpnp_monitorW[] = { - 'G','e','n','e','r','i','c',' ', - 'N','o','n','-','P','n','P',' ','M','o','n','i','t','o','r',0}; struct gdi_monitor *monitor;
monitor = calloc( 1, sizeof(*monitor) ); if (!monitor) return FALSE;
- lstrcpyW( monitor->name, generic_nonpnp_monitorW ); SetRect( &monitor->rc_monitor, 0, 0, desktop_width, desktop_height ); SetRect( &monitor->rc_work, 0, 0, desktop_width, desktop_height ); query_desktop_work_area( &monitor->rc_work ); diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 34085c49543..78de6a6f88b 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -589,10 +589,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
/* Initialize monitors */ for (monitor = 0; monitor < monitor_count; monitor++) - { - TRACE("monitor: %#x %s\n", monitor, wine_dbgstr_w(monitors[monitor].name)); device_manager->add_monitor( &monitors[monitor], param ); - }
handler->free_monitors(monitors, monitor_count);
diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 6835aa4a331..2691f9e9c5e 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -287,9 +287,6 @@ static void xinerama_free_adapters( struct gdi_adapter *adapters )
static BOOL xinerama_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **new_monitors, int *count ) { - static const WCHAR generic_nonpnp_monitorW[] = { - 'G','e','n','e','r','i','c',' ', - 'N','o','n','-','P','n','P',' ','M','o','n','i','t','o','r',0}; struct gdi_monitor *monitor; INT first = (INT)adapter_id; INT monitor_count = 0; @@ -319,7 +316,6 @@ static BOOL xinerama_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne || (EqualRect( &monitors[i].rcMonitor, &monitors[first].rcMonitor ) && !IsRectEmpty( &monitors[first].rcMonitor ))) { - lstrcpyW( monitor[index].name, generic_nonpnp_monitorW ); monitor[index].rc_monitor = monitors[i].rcMonitor; monitor[index].rc_work = monitors[i].rcWork; /* Xinerama only reports monitors already attached */ diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 2b0ee253cea..7c32e683c5d 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -1027,9 +1027,6 @@ static void xrandr14_free_adapters( struct gdi_adapter *adapters )
static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **new_monitors, int *count ) { - static const WCHAR generic_nonpnp_monitorW[] = { - 'G','e','n','e','r','i','c',' ', - 'N','o','n','-','P','n','P',' ','M','o','n','i','t','o','r',0}; struct gdi_monitor *realloc_monitors, *monitors = NULL; XRRScreenResources *screen_resources = NULL; XRROutputInfo *output_info = NULL, *enum_output_info = NULL; @@ -1063,7 +1060,6 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne /* Inactive but attached monitor, no need to check for mirrored/replica monitors */ if (!output_info->crtc || !crtc_info->mode) { - lstrcpyW( monitors[monitor_count].name, generic_nonpnp_monitorW ); monitors[monitor_count].state_flags = DISPLAY_DEVICE_ATTACHED; monitors[monitor_count].edid_len = get_edid( adapter_id, &monitors[monitor_count].edid ); monitor_count = 1; @@ -1108,9 +1104,6 @@ static BOOL xrandr14_get_monitors( ULONG_PTR adapter_id, struct gdi_monitor **ne enum_crtc_info->width == crtc_info->width && enum_crtc_info->height == crtc_info->height) { - /* FIXME: Read output EDID property and parse the data to get the correct name */ - lstrcpyW( monitors[monitor_count].name, generic_nonpnp_monitorW ); - SetRect( &monitors[monitor_count].rc_monitor, crtc_info->x, crtc_info->y, crtc_info->x + crtc_info->width, crtc_info->y + crtc_info->height ); monitors[monitor_count].rc_work = get_work_area( &monitors[monitor_count].rc_monitor ); diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 3db3d0d6af3..3de7e20af9a 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -253,7 +253,6 @@ struct gdi_adapter
struct gdi_monitor { - WCHAR name[128]; /* name */ RECT rc_monitor; /* RcMonitor in MONITORINFO struct */ RECT rc_work; /* RcWork in MONITORINFO struct */ DWORD state_flags; /* StateFlags in DISPLAY_DEVICE struct */