Skip to content

Commit e46b555

Browse files
committed
25.4.20 Some fix
1 parent c0f1ae2 commit e46b555

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

tewv/Resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
#define STRING2(str) #str
66
#define VER_Y 25
77
#define VER_M 4
8-
#define VER_D 14
8+
#define VER_D 20
99
#define VER_Z 0

tewv/tewv.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const TCHAR g_szClsid[] = TEXT("{55BBF1B8-0D30-4908-BE0C-D576612A0F48}");
1111
HINSTANCE g_hinstDll = NULL;
1212
LPWSTR g_versionInfo = NULL;
1313
LONG g_lLocks = 0;
14+
int g_deviceYDPI = 96;
1415
#ifdef _DEBUG
1516
HMODULE g_hWebView2Loader = NULL;
1617
LPFNCreateCoreWebView2EnvironmentWithOptions _CreateCoreWebView2EnvironmentWithOptions = NULL;
@@ -1076,7 +1077,10 @@ STDMETHODIMP CteBase::DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSit
10761077
if (iVerb == OLEIVERB_INPLACEACTIVATE) {
10771078
m_hwndParent = hwndParent;
10781079
WCHAR pszDataPath[MAX_PATH], pszSetting[MAX_PATHEX + 128], pszProxyServer[MAX_PATHEX], pszProxyOverride[MAX_PATHEX], pszTemp[MAX_PATHEX];
1079-
lstrcpy(pszSetting, L"--allow-file-access-from-files --disable-gpu --embedded-browser-webview-dpi-awareness=1");
1080+
HDC hdc = GetDC(hwndParent);
1081+
g_deviceYDPI = GetDeviceCaps(hdc, LOGPIXELSY);
1082+
ReleaseDC(hwndParent, hdc);
1083+
swprintf_s(pszSetting, MAX_PATH, L"--allow-file-access-from-files --disable-gpu --disable-extensions --disable-features=IsolateOrigins,site-per-process --force-device-scale-factor=%g", g_deviceYDPI / 96.0);
10801084
GetTempPath(MAX_PATH, pszDataPath);
10811085
PathAppend(pszDataPath, L"tablacus");
10821086

@@ -1222,10 +1226,7 @@ STDMETHODIMP CteBase::SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect)
12221226
GetClientRect(m_hwndParent, &bounds);
12231227
lprcClipRect = &bounds;
12241228
}
1225-
HDC hdc = GetDC(m_hwndParent);
1226-
int deviceYDPI = GetDeviceCaps(hdc, LOGPIXELSY);
1227-
ReleaseDC(m_hwndParent, hdc);
1228-
m_webviewController->SetBoundsAndZoomFactor(*lprcClipRect, 96.0 / deviceYDPI);
1229+
m_webviewController->SetBoundsAndZoomFactor(*lprcClipRect, 96.0 / g_deviceYDPI);
12291230
CopyRect(&m_webviewBounds, lprcClipRect);
12301231
return S_OK;
12311232
}

0 commit comments

Comments
 (0)