aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-html5-demo/recipes-wam/cef/files/cef/0008-Allow-passing-the-app_id-on-widget-creation.patch
blob: e0a79b6c2b20b8aedccdbbeab6cac364995bfbb5 (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
From 5a8d9996ee7b3ce77f7b3fd3c7839806a034ea16 Mon Sep 17 00:00:00 2001
From: Roger Zanoni <rzanoni@igalia.com>
Date: Tue, 4 Jul 2023 12:10:41 +0200
Subject: [PATCH 08/10] Allow passing the app_id on widget creation

---
 include/views/cef_window.h          |  6 ++++++
 libcef/browser/views/window_impl.cc | 13 +++++++++----
 libcef/browser/views/window_impl.h  |  6 ++++--
 libcef/browser/views/window_view.cc |  3 ++-
 libcef/browser/views/window_view.h  |  2 +-
 5 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/include/views/cef_window.h b/include/views/cef_window.h
index 9f196a1e7..16c854b09 100644
--- a/include/views/cef_window.h
+++ b/include/views/cef_window.h
@@ -65,6 +65,12 @@ class CefWindow : public CefPanel {
       CefRefPtr<CefWindowDelegate> delegate);
 
   ///
+  /// Create a new Window with the provided ID
+  ///
+  /*--cef()--*/
+  static CefRefPtr<CefWindow> CreateTopLevelWindowWithId(
+      CefRefPtr<CefWindowDelegate> delegate, const CefString& app_id);
+  ///
   /// Show the Window.
   ///
   /*--cef()--*/
diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc
index 12858364e..f0fe9dfb2 100644
--- a/libcef/browser/views/window_impl.cc
+++ b/libcef/browser/views/window_impl.cc
@@ -110,14 +110,19 @@ CefRefPtr<CefWindow> CefWindow::CreateTopLevelWindow(
   return CefWindowImpl::Create(delegate, gfx::kNullAcceleratedWidget);
 }
 
+CefRefPtr<CefWindow> CefWindow::CreateTopLevelWindowWithId(
+    CefRefPtr<CefWindowDelegate> delegate, const CefString& app_id) {
+  return CefWindowImpl::Create(delegate, gfx::kNullAcceleratedWidget, app_id);
+}
+
 // static
 CefRefPtr<CefWindowImpl> CefWindowImpl::Create(
     CefRefPtr<CefWindowDelegate> delegate,
-    gfx::AcceleratedWidget parent_widget) {
+    gfx::AcceleratedWidget parent_widget, const CefString& app_id) {
   CEF_REQUIRE_UIT_RETURN(nullptr);
   CefRefPtr<CefWindowImpl> window = new CefWindowImpl(delegate);
   window->Initialize();
-  window->CreateWidget(parent_widget);
+  window->CreateWidget(parent_widget, app_id);
   return window;
 }
 
@@ -745,10 +750,10 @@ void CefWindowImpl::InitializeRootView() {
   static_cast<CefWindowView*>(root_view())->Initialize();
 }
 
-void CefWindowImpl::CreateWidget(gfx::AcceleratedWidget parent_widget) {
+void CefWindowImpl::CreateWidget(gfx::AcceleratedWidget parent_widget, const CefString& app_id) {
   DCHECK(!widget_);
 
-  root_view()->CreateWidget(parent_widget);
+  root_view()->CreateWidget(parent_widget, app_id);
   widget_ = root_view()->GetWidget();
   DCHECK(widget_);
 
diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h
index aaca3c281..1c5be736f 100644
--- a/libcef/browser/views/window_impl.h
+++ b/libcef/browser/views/window_impl.h
@@ -36,7 +36,8 @@ class CefWindowImpl
   // Create a new CefWindow instance. |delegate| may be nullptr. |parent_widget|
   // will be used when creating a Chrome child window.
   static CefRefPtr<CefWindowImpl> Create(CefRefPtr<CefWindowDelegate> delegate,
-                                         gfx::AcceleratedWidget parent_widget);
+                                         gfx::AcceleratedWidget parent_widget,
+                                         const CefString& app_id = "");
 
   // CefWindow methods:
   void Show() override;
@@ -157,7 +158,8 @@ class CefWindowImpl
   void InitializeRootView() override;
 
   // Initialize the Widget.
-  void CreateWidget(gfx::AcceleratedWidget parent_widget);
+  void CreateWidget(gfx::AcceleratedWidget parent_widget,
+                    const CefString& app_id = "");
 
   views::Widget* widget_ = nullptr;
 
diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc
index 2331caaea..5e4cb6b53 100644
--- a/libcef/browser/views/window_view.cc
+++ b/libcef/browser/views/window_view.cc
@@ -371,7 +371,7 @@ CefWindowView::CefWindowView(CefWindowDelegate* cef_delegate,
   DCHECK(window_delegate_);
 }
 
-void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
+void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget, const CefString& app_id) {
   DCHECK(!GetWidget());
 
   // |widget| is owned by the NativeWidget and will be destroyed in response to
@@ -381,6 +381,7 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
 
   views::Widget::InitParams params;
   params.delegate = this;
+  params.wayland_app_id = app_id;
 
   views::Widget* host_widget = nullptr;
 
diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h
index b065f3700..c15e75d65 100644
--- a/libcef/browser/views/window_view.h
+++ b/libcef/browser/views/window_view.h
@@ -52,7 +52,7 @@ class CefWindowView
   CefWindowView& operator=(const CefWindowView&) = delete;
 
   // Create the Widget.
-  void CreateWidget(gfx::AcceleratedWidget parent_widget);
+  void CreateWidget(gfx::AcceleratedWidget parent_widget, const CefString& app_id);
 
   // Returns the CefWindow associated with this view. See comments on
   // CefViewView::GetCefView.
-- 
2.42.1