gdi32: Fall back to GetSystemMetrics() for the screen size.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f49227db60
commit
6d395fcca4
|
@ -30,6 +30,7 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "ddrawgdi.h"
|
#include "ddrawgdi.h"
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
|
#include "winuser.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
|
|
||||||
#include "gdi_private.h"
|
#include "gdi_private.h"
|
||||||
|
@ -60,6 +61,9 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
|
||||||
};
|
};
|
||||||
static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
static typeof(GetDesktopWindow) *pGetDesktopWindow;
|
||||||
|
static typeof(GetSystemMetrics) *pGetSystemMetrics;
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* create_driver
|
* create_driver
|
||||||
*
|
*
|
||||||
|
@ -97,7 +101,7 @@ static const struct gdi_dc_funcs *get_display_driver(void)
|
||||||
if (!display_driver)
|
if (!display_driver)
|
||||||
{
|
{
|
||||||
HMODULE user32 = LoadLibraryA( "user32.dll" );
|
HMODULE user32 = LoadLibraryA( "user32.dll" );
|
||||||
HWND (WINAPI *pGetDesktopWindow)(void) = (void *)GetProcAddress( user32, "GetDesktopWindow" );
|
pGetDesktopWindow = (void *)GetProcAddress( user32, "GetDesktopWindow" );
|
||||||
|
|
||||||
if (!pGetDesktopWindow() || !display_driver)
|
if (!pGetDesktopWindow() || !display_driver)
|
||||||
{
|
{
|
||||||
|
@ -166,6 +170,7 @@ done:
|
||||||
void CDECL __wine_set_display_driver( HMODULE module )
|
void CDECL __wine_set_display_driver( HMODULE module )
|
||||||
{
|
{
|
||||||
struct graphics_driver *driver;
|
struct graphics_driver *driver;
|
||||||
|
HMODULE user32;
|
||||||
|
|
||||||
if (!(driver = create_driver( module )))
|
if (!(driver = create_driver( module )))
|
||||||
{
|
{
|
||||||
|
@ -174,6 +179,9 @@ void CDECL __wine_set_display_driver( HMODULE module )
|
||||||
}
|
}
|
||||||
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
|
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
|
||||||
HeapFree( GetProcessHeap(), 0, driver );
|
HeapFree( GetProcessHeap(), 0, driver );
|
||||||
|
|
||||||
|
user32 = LoadLibraryA( "user32.dll" );
|
||||||
|
pGetSystemMetrics = (void *)GetProcAddress( user32, "GetSystemMetrics" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,8 +316,8 @@ static INT nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
|
||||||
GetDeviceCaps( dev->hdc, LOGPIXELSX ) * 10 );
|
GetDeviceCaps( dev->hdc, LOGPIXELSX ) * 10 );
|
||||||
case VERTSIZE: return MulDiv( GetDeviceCaps( dev->hdc, VERTRES ), 254,
|
case VERTSIZE: return MulDiv( GetDeviceCaps( dev->hdc, VERTRES ), 254,
|
||||||
GetDeviceCaps( dev->hdc, LOGPIXELSY ) * 10 );
|
GetDeviceCaps( dev->hdc, LOGPIXELSY ) * 10 );
|
||||||
case HORZRES: return 640;
|
case HORZRES: return pGetSystemMetrics ? pGetSystemMetrics( SM_CXSCREEN ) : 640;
|
||||||
case VERTRES: return 480;
|
case VERTRES: return pGetSystemMetrics ? pGetSystemMetrics( SM_CYSCREEN ) : 480;
|
||||||
case BITSPIXEL: return 32;
|
case BITSPIXEL: return 32;
|
||||||
case PLANES: return 1;
|
case PLANES: return 1;
|
||||||
case NUMBRUSHES: return -1;
|
case NUMBRUSHES: return -1;
|
||||||
|
|
Loading…
Reference in New Issue