Commit feb4f26b authored by LRN's avatar LRN
Browse files

GDK W32: Use PROCESS_PER_MONITOR_DPI_AWARE

According to Microsoft documentation, PROCESS_SYSTEM_DPI_AWARE, just as
PROCESS_DPI_UNAWARE, allows Windows to scale GTK windows and do all kinds
of stuff. To ensure this doesn't happen, we need to use PROCESS_PER_MONITOR_DPI_AWARE,
even if GTK does not really handle DPI changes dynamically via the  WM_DPICHANGED
message.

This completely prevents Windows from scaling GTK windows when they are moved
between screens with different scaling set up.
parent 9216fe2c
Pipeline #263778 passed with stages
in 34 minutes and 36 seconds
......@@ -916,10 +916,10 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
/* then make the GDK-using app DPI-aware */
if (display->shcore_funcs.setDpiAwareFunc != NULL)
{
switch (display->shcore_funcs.setDpiAwareFunc (PROCESS_SYSTEM_DPI_AWARE))
switch (display->shcore_funcs.setDpiAwareFunc (PROCESS_PER_MONITOR_DPI_AWARE))
{
case S_OK:
display->dpi_aware_type = PROCESS_SYSTEM_DPI_AWARE;
display->dpi_aware_type = PROCESS_PER_MONITOR_DPI_AWARE;
status = DPI_STATUS_SUCCESS;
break;
case E_ACCESSDENIED:
......@@ -1000,10 +1000,10 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
/* This most probably means DPI awareness is set through
the manifest, or a DPI compatibility setting is used. */
display->dpi_aware_type = display->user32_dpi_funcs.isDpiAwareFunc () ?
PROCESS_SYSTEM_DPI_AWARE :
PROCESS_PER_MONITOR_DPI_AWARE :
PROCESS_DPI_UNAWARE;
if (display->dpi_aware_type == PROCESS_SYSTEM_DPI_AWARE)
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE)
status = DPI_STATUS_SUCCESS;
else
status = DPI_STATUS_DISABLED;
......
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