recipes-demo/homescreen/homescreen_git.bb: Bump SRCREV
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0003-agl-Only-bind-to-agl_shell-if-it-s-the-browser-proce.patch
1 From ab07780e04f15b511967cd609b70fb97abcea96f Mon Sep 17 00:00:00 2001
2 From: Roger Zanoni <rzanoni@igalia.com>
3 Date: Sat, 27 May 2023 15:55:17 +0200
4 Subject: [PATCH 03/33] [agl] Only bind to agl_shell if it's the browser
5  process
6
7 Signed-off-by: Roger Zanoni <rzanoni@igalia.com>
8 ---
9  .../extensions/agl/host/wayland_extensions_agl_impl.cc   | 9 +++++++--
10  1 file changed, 7 insertions(+), 2 deletions(-)
11
12 diff --git a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc
13 index 87376cbb8a9d3..075b3010ea8a1 100644
14 --- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc
15 +++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc
16 @@ -20,6 +20,7 @@
17  
18  #include "base/command_line.h"
19  #include "base/logging.h"
20 +#include "content/public/common/content_switches.h"
21  #include "ui/base/ui_base_switches.h"
22  #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h"
23  #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h"
24 @@ -45,8 +46,12 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry,
25                                      uint32_t name,
26                                      const char* interface,
27                                      uint32_t version) {
28 -  bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch(
29 -      switches::kAglShellAppId);
30 +  bool has_agl_shell_switch = base::CommandLine::ForCurrentProcess()->HasSwitch(
31 +          switches::kAglShellAppId);
32 +  bool is_browser_process = !base::CommandLine::ForCurrentProcess()->HasSwitch(
33 +          switches::kProcessType);
34 +  bool should_use_agl_shell = has_agl_shell_switch && is_browser_process;
35 +
36    bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion,
37                                kMaxAglShellExtensionVersion);
38    bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0);
39 -- 
40 2.42.1
41