Skip to content

Commit

Permalink
Don't use WebView embed in Windows before 8.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Apr 20, 2022
1 parent cc510d3 commit 0e9c8d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions webview/platform/win/webview_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,29 @@
namespace Webview {

Available Availability() {
if (!Platform::IsWindows8Point1OrGreater()) {
return Available{
.error = Available::Error::OldWindows,
.details = "Please update your system to Windows 8.1 or later.",
};
}
if (EdgeHtml::Supported() || EdgeChromium::Supported()) {
return Available{};
}
return Available{
.error = Available::Error::NoWebview2,
.details = "Please install Microsoft Edge Webview2 Runtime.",
};
// WebKit2Gtk::Supported();
}

bool SupportsEmbedAfterCreate() {
return EdgeHtml::Supported();
}

std::unique_ptr<Interface> CreateInstance(Config config) {
if (Platform::IsWindows11OrGreater()) {
if (!Platform::IsWindows8Point1OrGreater()) {
return nullptr;
} else if (Platform::IsWindows11OrGreater()) {
if (auto result = EdgeChromium::CreateInstance(std::move(config))) {
return result;
}
Expand Down
1 change: 1 addition & 0 deletions webview/webview_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct Available {
NoGtkOrWebkit2Gtk,
MutterWM,
Wayland,
OldWindows,
};
Error error = Error::None;
std::string details;
Expand Down

0 comments on commit 0e9c8d8

Please sign in to comment.