summaryrefslogtreecommitdiffstats
path: root/recipes-wam/cef/files/cef/0007-Add-a-method-to-check-if-the-agl-window-is-configure.patch
blob: 14897f1a77000c6abd4ad40f1110ff76e940fb70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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