From e91a133673f9524c5f7db9bdbad1aff61b3887d7 Mon Sep 17 00:00:00 2001 From: 1zuna Date: Thu, 16 Nov 2023 13:19:00 +0100 Subject: [PATCH] set windowless fps to 120 --- native/CefBrowser_N.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/native/CefBrowser_N.cpp b/native/CefBrowser_N.cpp index f7f17cd8..312fac6f 100644 --- a/native/CefBrowser_N.cpp +++ b/native/CefBrowser_N.cpp @@ -933,6 +933,7 @@ void create(std::shared_ptr objs, CefBrowserSettings settings; + settings.windowless_frame_rate = 120; if (transparent == JNI_FALSE) { // Specify an opaque background color (white) to disable transparency. settings.background_color = CefColorSetARGB(255, 255, 255, 255); @@ -1385,6 +1386,7 @@ Java_org_cef_browser_CefBrowser_1N_N_1SetFocus(JNIEnv* env, jboolean enable) { CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj); browser->GetHost()->SetFocus(enable != JNI_FALSE); + browser->GetHost()->SetWindowlessFrameRate(120); } JNIEXPORT void JNICALL @@ -1392,7 +1394,7 @@ Java_org_cef_browser_CefBrowser_1N_N_1SetWindowVisibility(JNIEnv* env, jobject obj, jboolean visible) { CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj); - + browser->GetHost()->SetWindowlessFrameRate(120); #if defined(OS_MACOSX) if (!browser->GetHost()->IsWindowRenderingDisabled()) { util_mac::SetVisibility(browser->GetHost()->GetWindowHandle(), @@ -1532,6 +1534,7 @@ Java_org_cef_browser_CefBrowser_1N_N_1WasResized(JNIEnv* env, jint width, jint height) { CefRefPtr browser = JNI_GET_BROWSER_OR_RETURN(env, obj); + if (browser->GetHost()->IsWindowRenderingDisabled()) { browser->GetHost()->WasResized(); } @@ -1546,6 +1549,8 @@ Java_org_cef_browser_CefBrowser_1N_N_1WasResized(JNIEnv* env, } } #endif + + browser->GetHost()->SetWindowlessFrameRate(120); } JNIEXPORT void JNICALL