From 5e51f426facb90447f76d78598f9c71e6395dc33 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Mon, 21 Jun 2021 14:12:05 +1000 Subject: [PATCH] [windows] Fix app size, disable devtools in production build --- v2/internal/ffenestri/ffenestri_windows.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/v2/internal/ffenestri/ffenestri_windows.cpp b/v2/internal/ffenestri/ffenestri_windows.cpp index 93209b9b..4e4ecf7f 100644 --- a/v2/internal/ffenestri/ffenestri_windows.cpp +++ b/v2/internal/ffenestri/ffenestri_windows.cpp @@ -297,6 +297,11 @@ bool initWebView2(struct Application *app, int debugEnabled, messageCallback cb) controller = webviewController; controller->get_CoreWebView2(&webview); webview->AddRef(); + ICoreWebView2Settings* settings; + webview->get_Settings(&settings); + if ( debugEnabled == 0 ) { + settings->put_AreDefaultContextMenusEnabled(FALSE); + } flag.clear(); })); if (!SUCCEEDED(res)) @@ -416,7 +421,7 @@ void Run(struct Application* app, int argc, char **argv) { windowStyle, // Window style // Size and position - CW_USEDEFAULT, CW_USEDEFAULT, 1024, 768, + CW_USEDEFAULT, CW_USEDEFAULT, app->width, app->height, NULL, // Parent window NULL, // Menu @@ -468,7 +473,7 @@ void Run(struct Application* app, int argc, char **argv) { SetFocus(app->window); // Add webview2 - initWebView2(app, 1, initialCallback); + initWebView2(app, debug, initialCallback); if( app->webviewIsTranparent ) { wchar_t szBuff[64];