Under the HKCU\Software\Wine\X11 Driver global or application-specific HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver registry keys.
This option can be used to restore the old behavior with DPI awareness forced on every application, which some of them handled well enough even if not DPI aware otherwise.
From: Rémi Bernon rbernon@codeweavers.com
Under the HKCU\Software\Wine\X11 Driver global or application-specific HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver registry keys.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57175 --- dlls/win32u/sysparams.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 70e330e6017..25b3ffd9a0f 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -4934,6 +4934,7 @@ static DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name, void sysparams_init(void) { WCHAR buffer[MAX_PATH+16], *p, *appname; + BOOL force_dpi_awareness = FALSE; DWORD i, dispos, dpi_scaling; WCHAR layout[KL_NAMELENGTH]; pthread_mutexattr_t attr; @@ -5032,8 +5033,12 @@ void sysparams_init(void) grab_fullscreen = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "Decorated", buffer, sizeof(buffer) )) decorated_mode = IS_OPTION_TRUE( buffer[0] ); + if (!get_config_key( hkey, appkey, "ForceDpiAwareness", buffer, sizeof(buffer) )) + force_dpi_awareness = IS_OPTION_TRUE( buffer[0] );
#undef IS_OPTION_TRUE + + if (force_dpi_awareness) NtUserSetProcessDpiAwarenessContext( NTUSER_DPI_PER_MONITOR_AWARE, 0 ); }
static BOOL update_desktop_wallpaper(void)
From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57175 --- programs/winecfg/resource.h | 1 + programs/winecfg/winecfg.rc | 3 ++- programs/winecfg/x11drvdlg.c | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/programs/winecfg/resource.h b/programs/winecfg/resource.h index cd7eaaf711e..d785551f317 100644 --- a/programs/winecfg/resource.h +++ b/programs/winecfg/resource.h @@ -125,6 +125,7 @@ #define IDC_ENABLE_MANAGED 1100 #define IDC_ENABLE_DECORATED 1101 #define IDC_FULLSCREEN_GRAB 1102 +#define IDC_FORCE_DPI_AWARENESS 1103
#define IDC_RES_TRACKBAR 1107 #define IDC_RES_DPIEDIT 1108 diff --git a/programs/winecfg/winecfg.rc b/programs/winecfg/winecfg.rc index 779a2f900e3..cd5b6d17d70 100644 --- a/programs/winecfg/winecfg.rc +++ b/programs/winecfg/winecfg.rc @@ -181,11 +181,12 @@ BEGIN EDITTEXT IDC_DESKTOP_WIDTH,84,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_HEIGHT,137,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
- GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,84 + GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,94 CONTROL "", IDC_RES_TRACKBAR, "msctls_trackbar32",WS_TABSTOP,12,105,171,15 EDITTEXT IDC_RES_DPIEDIT,188,105,23,13,ES_NUMBER|WS_TABSTOP LTEXT "#msgctxt#unit: dots/inch#dpi",IDC_STATIC,215,107,30,8 LTEXT "This is a sample text using 10 point Tahoma",IDC_RES_FONT_PREVIEW,15,124,230,49 + CONTROL "Force per-monitor DPI awareness for every application",IDC_FORCE_DPI_AWARENESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,173,230,10 END
IDD_DLLCFG DIALOG 0, 0, 260, 220 diff --git a/programs/winecfg/x11drvdlg.c b/programs/winecfg/x11drvdlg.c index aea52717a78..594b7292c55 100644 --- a/programs/winecfg/x11drvdlg.c +++ b/programs/winecfg/x11drvdlg.c @@ -138,6 +138,13 @@ static void init_dialog(HWND dialog) SendDlgItemMessageW(dialog, IDC_DESKTOP_HEIGHT, EM_LIMITTEXT, RES_MAXLEN, 0); }
+ buf = get_reg_key(config_key, keypath(L"X11 Driver"), L"ForceDpiAwareness", L"Y"); + if (IS_OPTION_TRUE(*buf)) + CheckDlgButton(dialog, IDC_FORCE_DPI_AWARENESS, BST_CHECKED); + else + CheckDlgButton(dialog, IDC_FORCE_DPI_AWARENESS, BST_UNCHECKED); + free(buf); + buf = get_reg_key(config_key, keypath(L"X11 Driver"), L"GrabFullscreen", L"N"); if (IS_OPTION_TRUE(*buf)) CheckDlgButton(dialog, IDC_FULLSCREEN_GRAB, BST_CHECKED); @@ -227,6 +234,14 @@ static void on_fullscreen_grab_clicked(HWND dialog) set_reg_key(config_key, keypath(L"X11 Driver"), L"GrabFullscreen", L"N"); }
+static void on_force_dpi_awareness_clicked(HWND dialog) +{ + if (IsDlgButtonChecked(dialog, IDC_FORCE_DPI_AWARENESS) == BST_CHECKED) + set_reg_key(config_key, keypath(L"X11 Driver"), L"ForceDpiAwareness", L"Y"); + else + set_reg_key(config_key, keypath(L"X11 Driver"), L"ForceDpiAwareness", L"N"); +} + static INT read_logpixels_reg(void) { DWORD dwLogPixels; @@ -383,6 +398,7 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) case IDC_ENABLE_MANAGED: on_enable_managed_clicked(hDlg); break; case IDC_ENABLE_DECORATED: on_enable_decorated_clicked(hDlg); break; case IDC_FULLSCREEN_GRAB: on_fullscreen_grab_clicked(hDlg); break; + case IDC_FORCE_DPI_AWARENESS: on_force_dpi_awareness_clicked(hDlg); break; } break; }
Emil Velikov (@xexaxo) commented about dlls/win32u/sysparams.c:
grab_fullscreen = IS_OPTION_TRUE( buffer[0] ); if (!get_config_key( hkey, appkey, "Decorated", buffer, sizeof(buffer) )) decorated_mode = IS_OPTION_TRUE( buffer[0] );
- if (!get_config_key( hkey, appkey, "ForceDpiAwareness", buffer, sizeof(buffer) ))
Maybe call this OverrideDpiAwareness - "force" seems rather ambiguous IMHO.
Looks like there's maybe an official setting for this on Windows, I'll try to find where it lives.
Jinoh Kang (@iamahuman) commented about programs/winecfg/winecfg.rc:
EDITTEXT IDC_DESKTOP_WIDTH,84,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED EDITTEXT IDC_DESKTOP_HEIGHT,137,68,40,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
- GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,84
- GROUPBOX "Screen resolution",IDC_STATIC,8,95,244,94 CONTROL "", IDC_RES_TRACKBAR, "msctls_trackbar32",WS_TABSTOP,12,105,171,15 EDITTEXT IDC_RES_DPIEDIT,188,105,23,13,ES_NUMBER|WS_TABSTOP LTEXT "#msgctxt#unit: dots/inch#dpi",IDC_STATIC,215,107,30,8 LTEXT "This is a sample text using 10 point Tahoma",IDC_RES_FONT_PREVIEW,15,124,230,49
- CONTROL "Force per-monitor DPI awareness for every application",IDC_FORCE_DPI_AWARENESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,173,230,10
`keypath("X11 Driver")` returns the `AppDefaults<program>` subkey if a specific application is selected. You need a more general description here.
```suggestion:-0+0 CONTROL "Force per-monitor DPI awareness",IDC_FORCE_DPI_AWARENESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,173,230,10 ```
On Thu Sep 19 14:01:22 2024 +0000, Jinoh Kang wrote:
`keypath("X11 Driver")` returns the `AppDefaults<program>` subkey if a specific application is selected. You need a more general description here.
CONTROL "Force per-monitor DPI awareness",IDC_FORCE_DPI_AWARENESS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,173,230,10
Interesting, I wasn't even aware we could change per-application settings like that.