Commit 7255f63a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

explorer: Set virtual desktop primary adapter display settings.

parent 99ef2dc4
......@@ -937,10 +937,10 @@ static const char *debugstr_devmodew( const DEVMODEW *devmode )
position );
}
static void initialize_display_settings(void)
static void initialize_display_settings( unsigned int width, unsigned int height )
{
DISPLAY_DEVICEW device = {.cb = sizeof(DISPLAY_DEVICEW)};
DWORD i = 0;
DWORD i = 0, flags = CDS_GLOBAL | CDS_UPDATEREGISTRY;
/* Store current display mode in the registry */
while (EnumDisplayDevicesW( NULL, i++, &device, 0 ))
......@@ -955,10 +955,24 @@ static void initialize_display_settings(void)
TRACE( "Device %s current display mode %s.\n", debugstr_w( device.DeviceName ), debugstr_devmodew( &devmode ) );
if (ChangeDisplaySettingsExW( device.DeviceName, &devmode, 0,
CDS_GLOBAL | CDS_NORESET | CDS_UPDATEREGISTRY, 0 ))
if (ChangeDisplaySettingsExW( device.DeviceName, &devmode, 0, flags | CDS_NORESET, 0 ))
ERR( "Failed to initialize registry display settings for %s.\n", debugstr_w( device.DeviceName ) );
}
if (!using_root)
{
DEVMODEW devmode =
{
.dmSize = sizeof(DEVMODEW),
.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT,
.dmPelsWidth = width,
.dmPelsHeight = height,
};
/* in virtual desktop mode, set the primary display settings to match desktop size */
if (ChangeDisplaySettingsExW( NULL, &devmode, 0, flags, NULL ))
ERR( "Failed to set primary display settings.\n" );
}
}
static void set_desktop_window_title( HWND hwnd, const WCHAR *name )
......@@ -1085,7 +1099,7 @@ void manage_desktop( WCHAR *arg )
if (thread) CloseHandle( thread );
SystemParametersInfoW( SPI_SETDESKWALLPAPER, 0, NULL, FALSE );
ClipCursor( NULL );
initialize_display_settings();
initialize_display_settings( width, height );
initialize_appbar();
if (using_root) enable_shell = FALSE;
......
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