win32u: Move get_awareness_from_dpi_awareness_context.

This commit is contained in:
Fabian Maurer 2024-02-24 17:50:59 +01:00 committed by Alexandre Julliard
parent 777a9d0f51
commit d96754213c

View file

@ -2187,6 +2187,27 @@ UINT get_win_monitor_dpi( HWND hwnd )
return system_dpi;
}
/* see GetAwarenessFromDpiAwarenessContext */
static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context )
{
switch ((ULONG_PTR)context)
{
case 0x10:
case 0x11:
case 0x12:
case 0x80000010:
case 0x80000011:
case 0x80000012:
return (ULONG_PTR)context & 3;
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE:
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE:
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE:
return ~(ULONG_PTR)context;
default:
return DPI_AWARENESS_INVALID;
}
}
/**********************************************************************
* get_thread_dpi_awareness
*/
@ -2240,27 +2261,6 @@ UINT get_system_dpi(void)
return system_dpi;
}
/* see GetAwarenessFromDpiAwarenessContext */
static DPI_AWARENESS get_awareness_from_dpi_awareness_context( DPI_AWARENESS_CONTEXT context )
{
switch ((ULONG_PTR)context)
{
case 0x10:
case 0x11:
case 0x12:
case 0x80000010:
case 0x80000011:
case 0x80000012:
return (ULONG_PTR)context & 3;
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_UNAWARE:
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_SYSTEM_AWARE:
case (ULONG_PTR)DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE:
return ~(ULONG_PTR)context;
default:
return DPI_AWARENESS_INVALID;
}
}
/**********************************************************************
* SetThreadDpiAwarenessContext (win32u.so)
*/