From 6a27a57384ff2cb5df8205e23551f9344ab031d8 Mon Sep 17 00:00:00 2001 From: Sheen Tian <5869938+tishion@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:32:55 +0800 Subject: [PATCH] fix: use GetFrameByIdentifier when CEF_VERSION_MAJOR > 121 --- CMakeLists.txt | 1 + cmake/DownloadCef.cmake | 1 + linux-arm-gen.sh | 0 linux-arm64-gen.sh | 0 linux-x86-gen.sh | 0 linux-x86_64-gen.sh | 0 mac-arm64-gen.sh | 0 mac-x86_64-gen.sh | 0 src/CefView/CefBrowserApp/CefViewBrowserClient.cpp | 7 ++++++- 9 files changed, 8 insertions(+), 1 deletion(-) mode change 100644 => 100755 linux-arm-gen.sh mode change 100644 => 100755 linux-arm64-gen.sh mode change 100644 => 100755 linux-x86-gen.sh mode change 100644 => 100755 linux-x86_64-gen.sh mode change 100644 => 100755 mac-arm64-gen.sh mode change 100644 => 100755 mac-x86_64-gen.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 149c7dc..58a0a32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,7 @@ if(NOT CEF_SDK_VERSION) # "119.4.4+g5d1e039+chromium-119.0.6045.199" # GOOD # "120.1.6+gf08b1fd+chromium-120.0.6099.71" # GOOD # "121.3.15+g4d3b0b4+chromium-121.0.6167.184" # GOOD + # "122.1.7+gdd187af+chromium-122.0.6261.29" set(DEFAULT_CEF_SDK_VER "119.4.4+g5d1e039+chromium-119.0.6045.199") message(STATUS "CEF_SDK_VERSION is empty, use default version ${DEFAULT_CEF_SDK_VER}\n" diff --git a/cmake/DownloadCef.cmake b/cmake/DownloadCef.cmake index b65d89b..0d2d538 100644 --- a/cmake/DownloadCef.cmake +++ b/cmake/DownloadCef.cmake @@ -2,6 +2,7 @@ # Generally, there is NO NEED to modify the following config # # Download CEF binary package +# https://cef-builds.spotifycdn.com/index.html # if(NOT CEF_SDK_VERSION) message(FATAL_ERROR "CEF_SDK_VERSION is missing!") diff --git a/linux-arm-gen.sh b/linux-arm-gen.sh old mode 100644 new mode 100755 diff --git a/linux-arm64-gen.sh b/linux-arm64-gen.sh old mode 100644 new mode 100755 diff --git a/linux-x86-gen.sh b/linux-x86-gen.sh old mode 100644 new mode 100755 diff --git a/linux-x86_64-gen.sh b/linux-x86_64-gen.sh old mode 100644 new mode 100755 diff --git a/mac-arm64-gen.sh b/mac-arm64-gen.sh old mode 100644 new mode 100755 diff --git a/mac-x86_64-gen.sh b/mac-x86_64-gen.sh old mode 100644 new mode 100755 diff --git a/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp b/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp index 8e4c27d..49107a2 100644 --- a/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp +++ b/src/CefView/CefBrowserApp/CefViewBrowserClient.cpp @@ -1,4 +1,4 @@ -#include +#include #pragma region std_headers #include @@ -106,7 +106,12 @@ CefViewBrowserClient::TriggerEvent(CefRefPtr browser, for (auto id : frameIds) { auto m = msg->Copy(); +#if CEF_VERSION_MAJOR > 121 auto frame = browser->GetFrameByIdentifier(id); +#else + auto frame = browser->GetFrame(id); +#endif + frame->SendProcessMessage(PID_RENDERER, m); }