Commit 70fbfa2c authored by Rob Walker's avatar Rob Walker Committed by Alexandre Julliard

winex11: Improve ChangeDisplaySettingsEx failed mode message.

The failed mode error message dumps all the mode fields, that were being tested. Change this output so that only the mode fields explicitly being matched against are displayed. Make the failed message use formatting consist with the trace message, earlier in this function. Signed-off-by: 's avatarRob Walker <bob.mt.wya@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 498042e0
......@@ -345,6 +345,7 @@ LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
DWORD i, dwBpp = 0;
DEVMODEW dm;
BOOL def_mode = TRUE;
char bpp_buffer[16], freq_buffer[18];
TRACE("(%s,%p,%p,0x%08x,%p)\n",debugstr_w(devname),devmode,hwnd,flags,lpvoid);
TRACE("flags=%s\n",_CDS_flags(flags));
......@@ -422,9 +423,14 @@ LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
return DISP_CHANGE_SUCCESSFUL;
}
/* no valid modes found */
ERR("No matching mode found %ux%ux%u @%u! (%s)\n",
devmode->dmPelsWidth, devmode->dmPelsHeight,
devmode->dmBitsPerPel, devmode->dmDisplayFrequency, handler_name);
/* no valid modes found, only print the fields we were trying to matching against */
bpp_buffer[0] = freq_buffer[0] = 0;
if (devmode->dmFields & DM_BITSPERPEL)
sprintf(bpp_buffer, "bpp=%u ", devmode->dmBitsPerPel);
if ((devmode->dmFields & DM_DISPLAYFREQUENCY) && (devmode->dmDisplayFrequency != 0))
sprintf(freq_buffer, "freq=%u ", devmode->dmDisplayFrequency);
ERR("No matching mode found: width=%d height=%d %s%s(%s)\n",
devmode->dmPelsWidth, devmode->dmPelsHeight, bpp_buffer, freq_buffer, handler_name);
return DISP_CHANGE_BADMODE;
}
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