summaryrefslogtreecommitdiffstats
path: root/recipes-wam/cef/files/cef/0007-Add-the-SetActivateRegion-method.patch
blob: e2d87065cb72786af15273785feb2a1bd81afc92 (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
From 6515114202a98f81950687b6656151fa7cfd5ab6 Mon Sep 17 00:00:00 2001
From: Roger Zanoni <rzanoni@igalia.com>
Date: Sun, 2 Jul 2023 12:08:59 +0200
Subject: [PATCH 7/9] Add the SetActivateRegion method

---
 include/views/cef_window.h             |  6 ++++++
 libcef/browser/views/view_util.h       |  1 +
 libcef/browser/views/view_util_aura.cc | 17 +++++++++++++++++
 libcef/browser/views/window_impl.cc    |  7 +++++++
 libcef/browser/views/window_impl.h     |  1 +
 5 files changed, 32 insertions(+)

diff --git a/include/views/cef_window.h b/include/views/cef_window.h
index c34963302..9f196a1e7 100644
--- a/include/views/cef_window.h
+++ b/include/views/cef_window.h
@@ -405,6 +405,12 @@ class CefWindow : public CefPanel {
   /*--cef()--*/
   virtual bool IsSurfaceConfigured() = 0;
 
+  ///
+  /// A hint for the compositor to use a custom area, rather than inferring the activation area.
+  ///
+  /*--cef()--*/
+  virtual void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) = 0;
+
   // -----------------
 };
 
diff --git a/libcef/browser/views/view_util.h b/libcef/browser/views/view_util.h
index bf657fd39..50037a198 100644
--- a/libcef/browser/views/view_util.h
+++ b/libcef/browser/views/view_util.h
@@ -173,6 +173,7 @@ void AglSetAppReady(views::Widget* widget);
 void AglSetBackGroundApp(views::Widget* widget);
 void AglSetPanelApp(views::Widget* widget, uint32_t edge);
 bool IsSurfaceConfigured(views::Widget* widget);
+void SetupActivationArea(views::Widget* widget, uint32_t x, uint32_t y, uint32_t width, uint32_t height);
 
 // -----------------
 
diff --git a/libcef/browser/views/view_util_aura.cc b/libcef/browser/views/view_util_aura.cc
index 2946a2d81..bf435078d 100644
--- a/libcef/browser/views/view_util_aura.cc
+++ b/libcef/browser/views/view_util_aura.cc
@@ -120,6 +120,23 @@ bool IsSurfaceConfigured(views::Widget* widget) {
   }
 }
 
+void SetupActivationArea(views::Widget* widget,
+                         uint32_t x,
+                         uint32_t y,
+                         uint32_t width,
+                         uint32_t height) {
+  if (!widget) {
+    return;
+  }
+  aura::Window* window = widget->GetNativeWindow();
+  if (window && window->GetRootWindow()) {
+    window->GetHost()->SetupActivationArea(x,
+                                           y,
+                                           width,
+                                           height);
+  }
+}
+
 // -----------------
 
 }  // namespace view_util
diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc
index 8edac98b5..12858364e 100644
--- a/libcef/browser/views/window_impl.cc
+++ b/libcef/browser/views/window_impl.cc
@@ -795,4 +795,11 @@ bool CefWindowImpl::IsSurfaceConfigured() {
   return view_util::IsSurfaceConfigured(widget_);
 }
 
+void CefWindowImpl::SetupActivationArea(uint32_t x,
+                                        uint32_t y,
+                                        uint32_t width,
+                                        uint32_t height) {
+  view_util::SetupActivationArea(widget_, x, y, width, height);
+}
+
 // -----------------
diff --git a/libcef/browser/views/window_impl.h b/libcef/browser/views/window_impl.h
index 7f7b47e1a..aaca3c281 100644
--- a/libcef/browser/views/window_impl.h
+++ b/libcef/browser/views/window_impl.h
@@ -142,6 +142,7 @@ class CefWindowImpl
   void AglSetBackGroundApp() override;
   void AglSetPanelApp(uint32_t edge) override;
   bool IsSurfaceConfigured() override;
+  void SetupActivationArea(uint32_t x, uint32_t y, uint32_t width, uint32_t height) override;
 
   // -----------------
 
-- 
2.42.0