On Thu, Apr 18, 2013 at 11:44:15PM +0300, agilboa@xxxxxxxxxx wrote: > On 04/18/2013 09:30 PM, Christophe Fergeau wrote: > >Hey Arnon, > > > >On Thu, Apr 18, 2013 at 08:58:30PM +0300, Arnon Gilboa wrote: > >>When enabling a disabled monitor, init_dev_mod() "failed to create DC", > >>and therefore due to the custom resolution received, in set_displays() > >>"No suitable mode found for display". > >Looking at init_dev_mode(), I don't really think this is related to the > >custom resolution. If I'm reading init_dev_mode() properly, the "failed to > >create DC" error is returned before trying to use the custom resolution. My > >guess would be that this function fails because the monitor is > >disabled/turned off. > sure, but when it's disabled -> you fail to create a DC -> cannot > set a custom resolution when you enable it. To my eyes, the root cause is that the monitor is disabled, and the way the code is laid out does not cope well with disabled monitors. After reading http://msdn.microsoft.com/en-us/library/windows/desktop/dd162617%28v=vs.85%29.aspx I wonder if it would be enough to move the LONG ret = ChangeDisplaySettingsEx(dev_info.DeviceName, &dev_mode, NULL, CDS_UPDATEREGISTRY | CDS_NORESET, NULL); call from set_displays() to before setting the custom resolution with ExtEscape. This ChangeDisplaySettingsEx call will be done with DM_POSITION set in dev_mode->dmFields, and the link above says: "To add a display monitor to a multiple-monitor system programmatically, set DEVMODE.dmFields to DM_POSITION and specify a position (using DEVMODE.dmPosition ) for the monitor you are adding " (I read this as 'this call will enable the monitor') Christophe
Attachment:
pgp3DlGn1aUQX.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel