recipes-demo/homescreen/homescreen_git.bb: Bump SRCREV
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / cef / 0007-Add-a-method-to-check-if-the-agl-window-is-configure.patch
1 From b22b5302f20678bca5f03fe1738ce06fc799263b Mon Sep 17 00:00:00 2001
2 From: Roger Zanoni <rzanoni@igalia.com>
3 Date: Fri, 30 Jun 2023 10:27:03 +0200
4 Subject: [PATCH 07/10] Add a method to check if the agl window is configured
5
6 ---
7  include/views/cef_window.h             |  6 ++++++
8  libcef/browser/views/view_util.h       |  1 +
9  libcef/browser/views/view_util_aura.cc | 20 +++++++++++++++-----
10  libcef/browser/views/window_impl.cc    |  4 ++++
11  libcef/browser/views/window_impl.h     |  1 +
12  5 files changed, 27 insertions(+), 5 deletions(-)
13
14 diff --git a/include/views/cef_window.h b/include/views/cef_window.h
15 index dfa7821bc..063529964 100644
16 --- a/include/views/cef_window.h
17 +++ b/include/views/cef_window.h
18 @@ -381,6 +381,12 @@ class CefWindow : public CefPanel {
19    /*--cef()--*/
20    virtual void AglSetPanelApp(uint32_t edge) = 0;
21  
22 +  ///
23 +  /// Tells if the window wayland surface is configured
24 +  ///
25 +  /*--cef()--*/
26 +  virtual bool IsSurfaceConfigured() = 0;
27 +
28    // -----------------
29  };
30  
31 diff --git a/libcef/browser/views/view_util.h b/libcef/browser/views/view_util.h
32 index 505c66d94..20b97038b 100644
33 --- a/libcef/browser/views/view_util.h
34 +++ b/libcef/browser/views/view_util.h
35 @@ -148,6 +148,7 @@ void AglSetAppId(views::Widget* widget, const std::string& app_id);
36  void AglSetAppReady(views::Widget* widget);
37  void AglSetBackGroundApp(views::Widget* widget);
38  void AglSetPanelApp(views::Widget* widget, uint32_t edge);
39 +bool IsSurfaceConfigured(views::Widget* widget);
40  
41  // -----------------
42  
43 diff --git a/libcef/browser/views/view_util_aura.cc b/libcef/browser/views/view_util_aura.cc
44 index 2ad2f3dc7..b5b4f414b 100644
45 --- a/libcef/browser/views/view_util_aura.cc
46 +++ b/libcef/browser/views/view_util_aura.cc
47 @@ -47,7 +47,7 @@ void AglActivateApp(views::Widget* widget, const std::string& app) {
48    }
49    aura::Window* window = widget->GetNativeWindow();
50    if (window && window->GetRootWindow()) {
51 -    return window->GetHost()->SetAglActivateApp(app);
52 +    window->GetHost()->SetAglActivateApp(app);
53    }
54  }
55  
56 @@ -57,7 +57,7 @@ void AglSetAppId(views::Widget* widget, const std::string& app_id) {
57    }
58    aura::Window* window = widget->GetNativeWindow();
59    if (window && window->GetRootWindow()) {
60 -    return window->GetHost()->SetAglAppId(app_id);
61 +    window->GetHost()->SetAglAppId(app_id);
62    }
63  }
64  
65 @@ -67,7 +67,7 @@ void AglSetAppReady(views::Widget* widget) {
66    }
67    aura::Window* window = widget->GetNativeWindow();
68    if (window && window->GetRootWindow()) {
69 -    return window->GetHost()->SetAglReady();
70 +    window->GetHost()->SetAglReady();
71    }
72  }
73  
74 @@ -77,7 +77,7 @@ void AglSetBackGroundApp(views::Widget* widget) {
75    }
76    aura::Window* window = widget->GetNativeWindow();
77    if (window && window->GetRootWindow()) {
78 -    return window->GetHost()->SetAglBackground();
79 +    window->GetHost()->SetAglBackground();
80    }
81  }
82  
83 @@ -87,7 +87,17 @@ void AglSetPanelApp(views::Widget* widget, uint32_t edge) {
84    }
85    aura::Window* window = widget->GetNativeWindow();
86    if (window && window->GetRootWindow()) {
87 -    return window->GetHost()->SetAglPanel(edge);
88 +    window->GetHost()->SetAglPanel(edge);
89 +  }
90 +}
91 +
92 +bool IsSurfaceConfigured(views::Widget* widget) {
93 +  if (!widget) {
94 +    return false;
95 +  }
96 +  aura::Window* window = widget->GetNativeWindow();
97 +  if (window && window->GetRootWindow()) {
98 +    return window->GetHost()->IsSurfaceConfigured();
99    }
100  }
101  
102 diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc
103 index 22a4d39f6..1b5d196ab 100644
104 --- a/libcef/browser/views/window_impl.cc
105 +++ b/libcef/browser/views/window_impl.cc
106 @@ -544,6 +544,10 @@ void CefWindowImpl::AglSetPanelApp(uint32_t edge) {
107    view_util::AglSetPanelApp(widget_, edge);
108  }
109  
110 +bool CefWindowImpl::IsSurfaceConfigured() {
111 +  return view_util::IsSurfaceConfigured(widget_);
112 +}
113 +
114  // -----------------
115  
116  void CefWindowImpl::SendKeyPress(int key_code, uint32 event_flags) {
117 diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h
118 index ad02904f9..4ab77dbe6 100644
119 --- a/libcef/browser/views/window_impl.h
120 +++ b/libcef/browser/views/window_impl.h
121 @@ -139,6 +139,7 @@ class CefWindowImpl
122    void AglSetAppReady() override;
123    void AglSetBackGroundApp() override;
124    void AglSetPanelApp(uint32_t edge) override;
125 +  bool IsSurfaceConfigured() override;
126  
127    // -----------------
128  
129 -- 
130 2.39.2
131