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:
parent
9befda5c26
commit
ea5f585e89
2 changed files with 13 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -81,6 +81,12 @@
|
|||
using it, i.e. this has the same effect as calling
|
||||
wxApp::MSWEnableDarkMode(). If set to 2, use dark mode unconditionally,
|
||||
as if this function were called with wxApp::DarkMode_Always argument.
|
||||
@flag{msw.native-dialogs-pmdpi}
|
||||
Some native win32 dialogs (like the font and colour pickers) are not
|
||||
per-monitor DPI aware, and wxWidgets will forcefully show them as
|
||||
system DPI aware when there are monitors with different DPI connected.
|
||||
If set to 1, these dialogs will always be shown as per-monitor DPI
|
||||
aware (when enabled in the manifest).
|
||||
@endFlagTable
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue