From 8a9db461ff788875220b28a1bd8cede509f02e51 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Sun, 7 Feb 2021 22:14:18 +0100 Subject: [PATCH] Implement wxWebView::GetVersionInfo() for macOS Return the operating system version as the WebKit version used by WKWebView is bound to the OS. (Also works for iOS) --- include/wx/osx/webview_webkit.h | 1 + src/osx/webview_webkit.mm | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 1c92faac73..1b5fd57b97 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -122,6 +122,7 @@ public: long style = 0, const wxString& name = wxASCII_STR(wxWebViewNameStr)) { return new wxWebViewWebKit(parent, id, url, pos, size, style, name); } + virtual wxVersionInfo GetVersionInfo() wxOVERRIDE; }; #endif // wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 5350081e78..a788f8c4a3 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -87,6 +87,17 @@ wxEND_EVENT_TABLE() @end #endif // macOS 10.13+ +//----------------------------------------------------------------------------- +// wxWebViewFactoryWebKit +//----------------------------------------------------------------------------- + +wxVersionInfo wxWebViewFactoryWebKit::GetVersionInfo() +{ + int verMaj, verMin, verMicro; + wxGetOsVersion(&verMaj, &verMin, &verMicro); + return wxVersionInfo("WKWebView", verMaj, verMin, verMicro); +} + // ---------------------------------------------------------------------------- // creation/destruction // ----------------------------------------------------------------------------