Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webview2 improvements: #463

Merged
merged 1 commit into from
May 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/window/win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ namespace SSC {
GetClientRect(window, &bounds);
controller->put_Bounds(bounds);
controller->AddRef();
controller->MoveFocus(COREWEBVIEW2_MOVE_FOCUS_REASON_PROGRAMMATIC);
}

ICoreWebView2Settings* Settings;
Expand All @@ -728,7 +729,9 @@ namespace SSC {
Settings->put_IsZoomControlEnabled(FALSE);

auto settings3 = (ICoreWebView2Settings3*) Settings;
settings3->put_AreBrowserAcceleratorKeysEnabled(FALSE);
if (!isDebugEnabled()) {
settings3->put_AreBrowserAcceleratorKeysEnabled(FALSE);
}

auto settings6 = (ICoreWebView2Settings6*) Settings;
settings6->put_IsPinchZoomEnabled(FALSE);
Expand Down Expand Up @@ -1119,9 +1122,7 @@ namespace SSC {
auto res = init();

if (!SUCCEEDED(res)) {
// TODO(trevnorris):
// 1. power-shell-out to download and run webview installer
// 2. restart app
std::cerr << "Webview2 failed to initialize: " << std::to_string(res) << std::endl;
}
}

Expand Down Expand Up @@ -1160,7 +1161,7 @@ namespace SSC {
}

void Window::showInspector () {
// TODO: show inspector.
webview->OpenDevToolsWindow();
}

void Window::exit (int code) {
Expand Down