[wam][cef] Add the CEF recipe
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / cef / 0007-Add-a-method-to-check-if-the-agl-window-is-configure.patch
diff --git a/recipes-wam/cef/files/cef/0007-Add-a-method-to-check-if-the-agl-window-is-configure.patch b/recipes-wam/cef/files/cef/0007-Add-a-method-to-check-if-the-agl-window-is-configure.patch
new file mode 100644 (file)
index 0000000..14897f1
--- /dev/null
@@ -0,0 +1,131 @@
+From b22b5302f20678bca5f03fe1738ce06fc799263b Mon Sep 17 00:00:00 2001
+From: Roger Zanoni <rzanoni@igalia.com>
+Date: Fri, 30 Jun 2023 10:27:03 +0200
+Subject: [PATCH 07/10] Add a method to check if the agl window is configured
+
+---
+ include/views/cef_window.h             |  6 ++++++
+ libcef/browser/views/view_util.h       |  1 +
+ libcef/browser/views/view_util_aura.cc | 20 +++++++++++++++-----
+ libcef/browser/views/window_impl.cc    |  4 ++++
+ libcef/browser/views/window_impl.h     |  1 +
+ 5 files changed, 27 insertions(+), 5 deletions(-)
+
+diff --git a/include/views/cef_window.h b/include/views/cef_window.h
+index dfa7821bc..063529964 100644
+--- a/include/views/cef_window.h
++++ b/include/views/cef_window.h
+@@ -381,6 +381,12 @@ class CefWindow : public CefPanel {
+   /*--cef()--*/
+   virtual void AglSetPanelApp(uint32_t edge) = 0;
++  ///
++  /// Tells if the window wayland surface is configured
++  ///
++  /*--cef()--*/
++  virtual bool IsSurfaceConfigured() = 0;
++
+   // -----------------
+ };
+diff --git a/libcef/browser/views/view_util.h b/libcef/browser/views/view_util.h
+index 505c66d94..20b97038b 100644
+--- a/libcef/browser/views/view_util.h
++++ b/libcef/browser/views/view_util.h
+@@ -148,6 +148,7 @@ void AglSetAppId(views::Widget* widget, const std::string& app_id);
+ void AglSetAppReady(views::Widget* widget);
+ void AglSetBackGroundApp(views::Widget* widget);
+ void AglSetPanelApp(views::Widget* widget, uint32_t edge);
++bool IsSurfaceConfigured(views::Widget* widget);
+ // -----------------
+diff --git a/libcef/browser/views/view_util_aura.cc b/libcef/browser/views/view_util_aura.cc
+index 2ad2f3dc7..b5b4f414b 100644
+--- a/libcef/browser/views/view_util_aura.cc
++++ b/libcef/browser/views/view_util_aura.cc
+@@ -47,7 +47,7 @@ void AglActivateApp(views::Widget* widget, const std::string& app) {
+   }
+   aura::Window* window = widget->GetNativeWindow();
+   if (window && window->GetRootWindow()) {
+-    return window->GetHost()->SetAglActivateApp(app);
++    window->GetHost()->SetAglActivateApp(app);
+   }
+ }
+@@ -57,7 +57,7 @@ void AglSetAppId(views::Widget* widget, const std::string& app_id) {
+   }
+   aura::Window* window = widget->GetNativeWindow();
+   if (window && window->GetRootWindow()) {
+-    return window->GetHost()->SetAglAppId(app_id);
++    window->GetHost()->SetAglAppId(app_id);
+   }
+ }
+@@ -67,7 +67,7 @@ void AglSetAppReady(views::Widget* widget) {
+   }
+   aura::Window* window = widget->GetNativeWindow();
+   if (window && window->GetRootWindow()) {
+-    return window->GetHost()->SetAglReady();
++    window->GetHost()->SetAglReady();
+   }
+ }
+@@ -77,7 +77,7 @@ void AglSetBackGroundApp(views::Widget* widget) {
+   }
+   aura::Window* window = widget->GetNativeWindow();
+   if (window && window->GetRootWindow()) {
+-    return window->GetHost()->SetAglBackground();
++    window->GetHost()->SetAglBackground();
+   }
+ }
+@@ -87,7 +87,17 @@ void AglSetPanelApp(views::Widget* widget, uint32_t edge) {
+   }
+   aura::Window* window = widget->GetNativeWindow();
+   if (window && window->GetRootWindow()) {
+-    return window->GetHost()->SetAglPanel(edge);
++    window->GetHost()->SetAglPanel(edge);
++  }
++}
++
++bool IsSurfaceConfigured(views::Widget* widget) {
++  if (!widget) {
++    return false;
++  }
++  aura::Window* window = widget->GetNativeWindow();
++  if (window && window->GetRootWindow()) {
++    return window->GetHost()->IsSurfaceConfigured();
+   }
+ }
+diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc
+index 22a4d39f6..1b5d196ab 100644
+--- a/libcef/browser/views/window_impl.cc
++++ b/libcef/browser/views/window_impl.cc
+@@ -544,6 +544,10 @@ void CefWindowImpl::AglSetPanelApp(uint32_t edge) {
+   view_util::AglSetPanelApp(widget_, edge);
+ }
++bool CefWindowImpl::IsSurfaceConfigured() {
++  return view_util::IsSurfaceConfigured(widget_);
++}
++
+ // -----------------
+ void CefWindowImpl::SendKeyPress(int key_code, uint32 event_flags) {
+diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h
+index ad02904f9..4ab77dbe6 100644
+--- a/libcef/browser/views/window_impl.h
++++ b/libcef/browser/views/window_impl.h
+@@ -139,6 +139,7 @@ class CefWindowImpl
+   void AglSetAppReady() override;
+   void AglSetBackGroundApp() override;
+   void AglSetPanelApp(uint32_t edge) override;
++  bool IsSurfaceConfigured() override;
+   // -----------------
+-- 
+2.39.2
+