Add system option to never use AutoSystemDpiAware

Add the option 'msw.native-dialogs-pmdpi' that will always show the native msw dialogs
as per monitor dpi aware, even when there are displays with different dpi.
This commit is contained in:
Maarten Bent 2023-12-10 18:24:14 +01:00
parent 9befda5c26
commit ea5f585e89
No known key found for this signature in database
GPG key ID: 58AAEE3F4A4FD070
2 changed files with 13 additions and 1 deletions

View file

@ -16,6 +16,7 @@
#include "wx/dynlib.h"
#include "wx/display.h"
#include "wx/sysopt.h"
namespace wxMSWImpl
{
@ -68,7 +69,12 @@ public:
static bool Needed()
{
// use system-dpi-aware context when there are displays with different DPI
// use system-dpi-aware context when:
// - the user did not set an option to force per-monitor context
// - there are displays with different DPI
if ( wxSystemOptions::GetOptionInt("msw.native-dialogs-pmdpi") == 1 )
return false;
bool diferentDPI = false;
for ( unsigned i = 1; i < wxDisplay::GetCount() && !diferentDPI; ++i )
diferentDPI = wxDisplay(0u).GetPPI() != wxDisplay(i).GetPPI();