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 ) ...@@ -2413,6 +2413,12 @@ INT WINAPI GetSystemMetrics( INT index )
return ret; return ret;
case SM_CXCURSOR: case SM_CXCURSOR:
case SM_CYCURSOR: 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; return 32;
case SM_CYMENU: case SM_CYMENU:
return GetSystemMetrics(SM_CYMENUSIZE) + 1; return GetSystemMetrics(SM_CYMENUSIZE) + 1;
......
...@@ -2696,6 +2696,14 @@ static BOOL is_font_enumerated(const char *name) ...@@ -2696,6 +2696,14 @@ static BOOL is_font_enumerated(const char *name)
return ret; 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) static void test_GetSystemMetrics( void)
{ {
TEXTMETRICA tmMenuFont; TEXTMETRICA tmMenuFont;
...@@ -2774,8 +2782,8 @@ static void test_GetSystemMetrics( void) ...@@ -2774,8 +2782,8 @@ static void test_GetSystemMetrics( void)
/* These don't depend on the Shell Icon Size registry value */ /* 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_CXICON, MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI ) );
ok_gsm( SM_CYICON, MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI ) ); ok_gsm( SM_CYICON, MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI ) );
/* SM_CXCURSOR */ ok_gsm( SM_CXCURSOR, get_cursor_size( MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI )));
/* SM_CYCURSOR */ ok_gsm( SM_CYCURSOR, get_cursor_size( MulDiv( 32, dpi, USER_DEFAULT_SCREEN_DPI )));
ok_gsm( SM_CYMENU, ncm.iMenuHeight + 1); ok_gsm( SM_CYMENU, ncm.iMenuHeight + 1);
ok_gsm( SM_CXFULLSCREEN, ok_gsm( SM_CXFULLSCREEN,
GetSystemMetrics( SM_CXMAXIMIZED) - 2 * GetSystemMetrics( SM_CXFRAME)); 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