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

win32u: Introduce a new internal WINE_DM_UNSUPPORTED display flag.

parent a225ad4e
...@@ -2136,6 +2136,8 @@ static const DEVMODEW *find_display_mode( const DEVMODEW *modes, DEVMODEW *devmo ...@@ -2136,6 +2136,8 @@ static const DEVMODEW *find_display_mode( const DEVMODEW *modes, DEVMODEW *devmo
for (mode = modes; mode && mode->dmSize; mode = NEXT_DEVMODEW(mode)) for (mode = modes; mode && mode->dmSize; mode = NEXT_DEVMODEW(mode))
{ {
if ((mode->dmFields & DM_DISPLAYFLAGS) && (mode->dmDisplayFlags & WINE_DM_UNSUPPORTED))
continue;
if ((devmode->dmFields & DM_BITSPERPEL) && devmode->dmBitsPerPel && devmode->dmBitsPerPel != mode->dmBitsPerPel) if ((devmode->dmFields & DM_BITSPERPEL) && devmode->dmBitsPerPel && devmode->dmBitsPerPel != mode->dmBitsPerPel)
continue; continue;
if ((devmode->dmFields & DM_PELSWIDTH) && devmode->dmPelsWidth != mode->dmPelsWidth) if ((devmode->dmFields & DM_PELSWIDTH) && devmode->dmPelsWidth != mode->dmPelsWidth)
...@@ -2527,6 +2529,8 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD index, DEVM ...@@ -2527,6 +2529,8 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD index, DEVM
else ret = user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, devmode ); else ret = user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, devmode );
adapter_release( adapter ); adapter_release( adapter );
devmode->dmDisplayFlags &= ~WINE_DM_UNSUPPORTED;
if (!ret) WARN( "Failed to query %s display settings.\n", debugstr_us(device) ); if (!ret) WARN( "Failed to query %s display settings.\n", debugstr_us(device) );
else TRACE( "position %dx%d, resolution %ux%u, frequency %u, depth %u, orientation %#x.\n", else TRACE( "position %dx%d, resolution %ux%u, frequency %u, depth %u, orientation %#x.\n",
devmode->dmPosition.x, devmode->dmPosition.y, devmode->dmPelsWidth, devmode->dmPelsHeight, devmode->dmPosition.x, devmode->dmPosition.y, devmode->dmPelsWidth, devmode->dmPelsHeight,
......
...@@ -97,6 +97,13 @@ static int display_mode_bits_per_pixel(CGDisplayModeRef display_mode) ...@@ -97,6 +97,13 @@ static int display_mode_bits_per_pixel(CGDisplayModeRef display_mode)
} }
static BOOL display_mode_is_supported(CGDisplayModeRef display_mode)
{
uint32_t io_flags = CGDisplayModeGetIOFlags(display_mode);
return (io_flags & kDisplayModeValidFlag) && (io_flags & kDisplayModeSafeFlag);
}
static void display_mode_to_devmode(CGDirectDisplayID display_id, CGDisplayModeRef display_mode, DEVMODEW *devmode) static void display_mode_to_devmode(CGDirectDisplayID display_id, CGDisplayModeRef display_mode, DEVMODEW *devmode)
{ {
uint32_t io_flags; uint32_t io_flags;
...@@ -124,6 +131,8 @@ static void display_mode_to_devmode(CGDirectDisplayID display_id, CGDisplayModeR ...@@ -124,6 +131,8 @@ static void display_mode_to_devmode(CGDirectDisplayID display_id, CGDisplayModeR
devmode->dmDisplayFlags = 0; devmode->dmDisplayFlags = 0;
if (io_flags & kDisplayModeInterlacedFlag) if (io_flags & kDisplayModeInterlacedFlag)
devmode->dmDisplayFlags |= DM_INTERLACED; devmode->dmDisplayFlags |= DM_INTERLACED;
if (!display_mode_is_supported(display_mode))
devmode->dmDisplayFlags |= WINE_DM_UNSUPPORTED;
devmode->dmFields |= DM_DISPLAYFLAGS; devmode->dmFields |= DM_DISPLAYFLAGS;
devmode->dmDisplayFrequency = CGDisplayModeGetRefreshRate(display_mode); devmode->dmDisplayFrequency = CGDisplayModeGetRefreshRate(display_mode);
...@@ -417,13 +426,6 @@ static int get_default_bpp(void) ...@@ -417,13 +426,6 @@ static int get_default_bpp(void)
} }
static BOOL display_mode_is_supported(CGDisplayModeRef display_mode)
{
uint32_t io_flags = CGDisplayModeGetIOFlags(display_mode);
return (io_flags & kDisplayModeValidFlag) && (io_flags & kDisplayModeSafeFlag);
}
#if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 #if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
static CFDictionaryRef create_mode_dict(CGDisplayModeRef display_mode, BOOL is_original) static CFDictionaryRef create_mode_dict(CGDisplayModeRef display_mode, BOOL is_original)
{ {
......
...@@ -269,6 +269,8 @@ struct gdi_device_manager ...@@ -269,6 +269,8 @@ struct gdi_device_manager
void (*add_mode)( const DEVMODEW *mode, void *param ); void (*add_mode)( const DEVMODEW *mode, void *param );
}; };
#define WINE_DM_UNSUPPORTED 0x80000000
struct tagUPDATELAYEREDWINDOWINFO; struct tagUPDATELAYEREDWINDOWINFO;
struct user_driver_funcs struct user_driver_funcs
......
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