mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-02 19:23:37 +00:00
explorer: Use debugstr_devmodew helper to trace display mode.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55146
This commit is contained in:
parent
8073c6be3f
commit
0e5b847f85
|
@ -918,29 +918,45 @@ static HMODULE load_graphics_driver( const WCHAR *driver, GUID *guid )
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *debugstr_devmodew( const DEVMODEW *devmode )
|
||||||
|
{
|
||||||
|
char position[32] = {0};
|
||||||
|
|
||||||
|
if (devmode->dmFields & DM_POSITION)
|
||||||
|
{
|
||||||
|
snprintf( position, sizeof(position), " at (%d,%d)",
|
||||||
|
(int)devmode->dmPosition.x, (int)devmode->dmPosition.y );
|
||||||
|
}
|
||||||
|
|
||||||
|
return wine_dbg_sprintf( "%ux%u %ubits %uHz rotated %u degrees%s",
|
||||||
|
(unsigned int)devmode->dmPelsWidth,
|
||||||
|
(unsigned int)devmode->dmPelsHeight,
|
||||||
|
(unsigned int)devmode->dmBitsPerPel,
|
||||||
|
(unsigned int)devmode->dmDisplayFrequency,
|
||||||
|
(unsigned int)devmode->dmDisplayOrientation * 90,
|
||||||
|
position );
|
||||||
|
}
|
||||||
|
|
||||||
static void initialize_display_settings(void)
|
static void initialize_display_settings(void)
|
||||||
{
|
{
|
||||||
DISPLAY_DEVICEW ddW;
|
DISPLAY_DEVICEW ddW;
|
||||||
DEVMODEW dmW;
|
|
||||||
DWORD i = 0;
|
DWORD i = 0;
|
||||||
|
|
||||||
/* Store current display mode in the registry */
|
/* Store current display mode in the registry */
|
||||||
ddW.cb = sizeof(ddW);
|
ddW.cb = sizeof(ddW);
|
||||||
memset(&dmW, 0, sizeof(dmW));
|
|
||||||
dmW.dmSize = sizeof(dmW);
|
|
||||||
while (EnumDisplayDevicesW( NULL, i++, &ddW, 0 ))
|
while (EnumDisplayDevicesW( NULL, i++, &ddW, 0 ))
|
||||||
{
|
{
|
||||||
if (!EnumDisplaySettingsExW( ddW.DeviceName, ENUM_CURRENT_SETTINGS, &dmW, 0))
|
DEVMODEW devmode = {.dmSize = sizeof(DEVMODEW)};
|
||||||
|
|
||||||
|
if (!EnumDisplaySettingsExW( ddW.DeviceName, ENUM_CURRENT_SETTINGS, &devmode, 0))
|
||||||
{
|
{
|
||||||
ERR( "Failed to query current display settings for %s.\n", debugstr_w(ddW.DeviceName) );
|
ERR( "Failed to query current display settings for %s.\n", debugstr_w(ddW.DeviceName) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE( "Device %s current display mode %lux%lu %luBits %luHz at %ld,%ld.\n",
|
TRACE( "Device %s current display mode %s.\n", debugstr_w( ddW.DeviceName ), debugstr_devmodew( &devmode ) );
|
||||||
debugstr_w( ddW.DeviceName ), dmW.dmPelsWidth, dmW.dmPelsHeight,
|
|
||||||
dmW.dmBitsPerPel, dmW.dmDisplayFrequency, dmW.dmPosition.x, dmW.dmPosition.y );
|
|
||||||
|
|
||||||
if (ChangeDisplaySettingsExW( ddW.DeviceName, &dmW, 0,
|
if (ChangeDisplaySettingsExW( ddW.DeviceName, &devmode, 0,
|
||||||
CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY, 0 ))
|
CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY, 0 ))
|
||||||
ERR( "Failed to initialize registry display settings for %s.\n", debugstr_w(ddW.DeviceName) );
|
ERR( "Failed to initialize registry display settings for %s.\n", debugstr_w(ddW.DeviceName) );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue