Commit d4654e57 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Scale cursor sizes with the screen DPI.

parent 759dd551
......@@ -2413,6 +2413,12 @@ INT WINAPI GetSystemMetrics( INT index )
return ret;
case SM_CXCURSOR:
case SM_CYCURSOR:
if (IsProcessDPIAware())
{
ret = MulDiv( 32, get_display_dpi(), USER_DEFAULT_SCREEN_DPI );
if (ret >= 64) return 64;
if (ret >= 48) return 48;
}
return 32;
case SM_CYMENU:
return GetSystemMetrics(SM_CYMENUSIZE) + 1;
......
......@@ -2696,6 +2696,14 @@ static BOOL is_font_enumerated(const char *name)
return ret;
}
static int get_cursor_size( int size )
{
/* only certain sizes are allowed for cursors */
if (size >= 64) return 64;
if (size >= 48) return 48;
return 32;
}
static void test_GetSystemMetrics( void)
{
TEXTMETRICA tmMenuFont;
......@@ -2774,8 +2782,8 @@ static void test_GetSystemMetrics( void)
/* These don't depend on the Shell Icon Size registry value */
ok_gsm( SM_CXICON, MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI ) );
ok_gsm( SM_CYICON, MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI ) );
/* SM_CXCURSOR */
/* SM_CYCURSOR */
ok_gsm( SM_CXCURSOR, get_cursor_size( MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI )));
ok_gsm( SM_CYCURSOR, get_cursor_size( MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI )));
ok_gsm( SM_CYMENU, ncm.iMenuHeight + 1);
ok_gsm( SM_CXFULLSCREEN,
GetSystemMetrics( SM_CXMAXIMIZED) - 2 * GetSystemMetrics( SM_CXFRAME));
......
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