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

win32u: Add is_primary parameter to GetCurrentDisplaySettings.

parent 81406eac
......@@ -759,7 +759,7 @@ static LONG nulldrv_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_
return DISP_CHANGE_FAILED;
}
static BOOL nulldrv_GetCurrentDisplaySettings( LPCWSTR name, LPDEVMODEW mode )
static BOOL nulldrv_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW mode )
{
return FALSE;
}
......@@ -1072,9 +1072,9 @@ static LONG loaderdrv_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primar
return load_driver()->pChangeDisplaySettings( displays, primary_name, hwnd, flags, lparam );
}
static BOOL loaderdrv_GetCurrentDisplaySettings( LPCWSTR name, LPDEVMODEW mode )
static BOOL loaderdrv_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW mode )
{
return load_driver()->pGetCurrentDisplaySettings( name, mode );
return load_driver()->pGetCurrentDisplaySettings( name, is_primary, mode );
}
static void loaderdrv_SetCursor( HCURSOR cursor )
......
......@@ -503,6 +503,12 @@ static BOOL adapter_set_registry_settings( const struct adapter *adapter, const
return ret;
}
static BOOL adapter_get_current_settings( const struct adapter *adapter, DEVMODEW *mode )
{
BOOL is_primary = !!(adapter->dev.state_flags & DISPLAY_DEVICE_PRIMARY_DEVICE);
return user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, is_primary, mode );
}
static int mode_compare(const void *p1, const void *p2)
{
BOOL a_interlaced, b_interlaced, a_stretched, b_stretched;
......@@ -2174,7 +2180,8 @@ static BOOL adapter_get_full_mode( const struct adapter *adapter, const DEVMODEW
if (!is_detached_mode( full_mode ) && (!full_mode->dmPelsWidth || !full_mode->dmPelsHeight || !(full_mode->dmFields & DM_POSITION)))
{
DEVMODEW current_mode = {.dmSize = sizeof(DEVMODEW)};
if (!user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, &current_mode )) return FALSE;
if (!adapter_get_current_settings( adapter, &current_mode )) return FALSE;
if (!full_mode->dmPelsWidth) full_mode->dmPelsWidth = current_mode.dmPelsWidth;
if (!full_mode->dmPelsHeight) full_mode->dmPelsHeight = current_mode.dmPelsHeight;
if (!(full_mode->dmFields & DM_POSITION))
......@@ -2215,7 +2222,7 @@ static DEVMODEW *get_display_settings( const WCHAR *devname, const DEVMODEW *dev
else
{
if (!devname) ret = adapter_get_registry_settings( adapter, mode );
else ret = user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, mode );
else ret = adapter_get_current_settings( adapter, mode );
if (!ret) goto done;
}
......@@ -2457,7 +2464,7 @@ static LONG apply_display_settings( const WCHAR *devname, const DEVMODEW *devmod
if ((adapter = find_adapter( NULL )))
{
DEVMODEW current_mode = {.dmSize = sizeof(DEVMODEW)};
user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, &current_mode );
adapter_get_current_settings( adapter, &current_mode );
adapter_release( adapter );
send_notify_message( NtUserGetDesktopWindow(), WM_DISPLAYCHANGE, current_mode.dmBitsPerPel,
......@@ -2502,7 +2509,7 @@ static BOOL adapter_enum_display_settings( const struct adapter *adapter, DWORD
DEVMODEW current_mode = {.dmSize = sizeof(DEVMODEW)};
const DEVMODEW *adapter_mode;
if (!(flags & EDS_ROTATEDMODE) && !user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, &current_mode ))
if (!(flags & EDS_ROTATEDMODE) && !adapter_get_current_settings( adapter, &current_mode ))
{
WARN( "Failed to query current display mode for EDS_ROTATEDMODE flag.\n" );
return FALSE;
......@@ -2550,7 +2557,7 @@ BOOL WINAPI NtUserEnumDisplaySettings( UNICODE_STRING *device, DWORD index, DEVM
devmode->dmDriverExtra = 0;
if (index == ENUM_REGISTRY_SETTINGS) ret = adapter_get_registry_settings( adapter, devmode );
else if (index == ENUM_CURRENT_SETTINGS) ret = user_driver->pGetCurrentDisplaySettings( adapter->dev.device_name, devmode );
else if (index == ENUM_CURRENT_SETTINGS) ret = adapter_get_current_settings( adapter, devmode );
else ret = adapter_enum_display_settings( adapter, index, devmode, flags );
adapter_release( adapter );
......
......@@ -306,7 +306,7 @@ BOOL ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag
/***********************************************************************
* ANDROID_GetCurrentDisplaySettings
*/
BOOL ANDROID_GetCurrentDisplaySettings( LPCWSTR name, LPDEVMODEW devmode )
BOOL ANDROID_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode )
{
devmode->u2.dmDisplayFlags = 0;
devmode->u1.s2.dmPosition.x = 0;
......
......@@ -893,7 +893,7 @@ static DEVMODEW *display_get_modes(CGDirectDisplayID display_id, int *modes_coun
* GetCurrentDisplaySettings (MACDRV.@)
*
*/
BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR devname, LPDEVMODEW devmode)
BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR devname, BOOL is_primary, LPDEVMODEW devmode)
{
struct macdrv_display *displays = NULL;
int num_displays, display_idx;
......@@ -901,7 +901,7 @@ BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR devname, LPDEVMODEW devmode)
CGDirectDisplayID display_id;
WCHAR *end;
TRACE("%s, %p + %hu\n", debugstr_w(devname), devmode, devmode->dmSize);
TRACE("%s, %u, %p + %hu\n", debugstr_w(devname), is_primary, devmode, devmode->dmSize);
init_original_display_mode();
......
......@@ -123,7 +123,7 @@ static inline struct macdrv_thread_data *macdrv_thread_data(void)
extern BOOL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags) DECLSPEC_HIDDEN;
extern void macdrv_Beep(void) DECLSPEC_HIDDEN;
extern LONG macdrv_ChangeDisplaySettings(LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid) DECLSPEC_HIDDEN;
extern BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR name, LPDEVMODEW devmode) DECLSPEC_HIDDEN;
extern BOOL macdrv_GetCurrentDisplaySettings(LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode) DECLSPEC_HIDDEN;
extern LRESULT macdrv_ClipboardWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
extern BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manager,
BOOL force, void *param ) DECLSPEC_HIDDEN;
......
......@@ -266,7 +266,7 @@ static DWORD get_display_depth(ULONG_PTR display_id)
* GetCurrentDisplaySettings (X11DRV.@)
*
*/
BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, LPDEVMODEW devmode )
BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode )
{
DEVMODEW mode;
ULONG_PTR id;
......
......@@ -214,7 +214,7 @@ extern BOOL X11DRV_SetCursorPos( INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_GetCursorPos( LPPOINT pos ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_ClipCursor( LPCRECT clip ) DECLSPEC_HIDDEN;
extern LONG X11DRV_ChangeDisplaySettings( LPDEVMODEW displays, LPCWSTR primary_name, HWND hwnd, DWORD flags, LPVOID lpvoid ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, LPDEVMODEW devmode ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_GetCurrentDisplaySettings( LPCWSTR name, BOOL is_primary, LPDEVMODEW devmode ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manager,
BOOL force, void *param ) DECLSPEC_HIDDEN;
extern BOOL X11DRV_CreateDesktopWindow( HWND hwnd ) DECLSPEC_HIDDEN;
......
......@@ -298,7 +298,7 @@ struct user_driver_funcs
void (*pUpdateClipboard)(void);
/* display modes */
LONG (*pChangeDisplaySettings)(LPDEVMODEW,LPCWSTR,HWND,DWORD,LPVOID);
BOOL (*pGetCurrentDisplaySettings)(LPCWSTR,LPDEVMODEW);
BOOL (*pGetCurrentDisplaySettings)(LPCWSTR,BOOL,LPDEVMODEW);
BOOL (*pUpdateDisplayDevices)(const struct gdi_device_manager *,BOOL,void*);
/* windowing functions */
BOOL (*pCreateDesktopWindow)(HWND);
......
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