8961b46499e60a3394f693f63ab20feb2b6afed0
[AGL/meta-agl-demo.git] / recipes-wam / cef / files / chromium / 0007-Only-bind-to-agl_shell-if-it-s-the-browser-process.patch
1 From 1b60d7d98be14175b5175ee6ba4c19da03d8188e 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 7/9] Only bind to agl_shell if it's the browser process
5
6 ---
7  .../extensions/agl/host/wayland_extensions_agl_impl.cc   | 9 +++++++--
8  1 file changed, 7 insertions(+), 2 deletions(-)
9
10 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
11 index 87376cbb8a9d3..075b3010ea8a1 100644
12 --- a/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc
13 +++ b/ui/ozone/platform/wayland/extensions/agl/host/wayland_extensions_agl_impl.cc
14 @@ -20,6 +20,7 @@
15  
16  #include "base/command_line.h"
17  #include "base/logging.h"
18 +#include "content/public/common/content_switches.h"
19  #include "ui/base/ui_base_switches.h"
20  #include "ui/ozone/platform/wayland/extensions/agl/host/agl_shell_wrapper.h"
21  #include "ui/ozone/platform/wayland/extensions/agl/host/wayland_window_agl.h"
22 @@ -45,8 +46,12 @@ bool WaylandExtensionsAglImpl::Bind(wl_registry* registry,
23                                      uint32_t name,
24                                      const char* interface,
25                                      uint32_t version) {
26 -  bool should_use_agl_shell = base::CommandLine::ForCurrentProcess()->HasSwitch(
27 -      switches::kAglShellAppId);
28 +  bool has_agl_shell_switch = base::CommandLine::ForCurrentProcess()->HasSwitch(
29 +          switches::kAglShellAppId);
30 +  bool is_browser_process = !base::CommandLine::ForCurrentProcess()->HasSwitch(
31 +          switches::kProcessType);
32 +  bool should_use_agl_shell = has_agl_shell_switch && is_browser_process;
33 +
34    bool can_bind = wl::CanBind(interface, version, kMinAglShellExtensionVersion,
35                                kMaxAglShellExtensionVersion);
36    bool is_agl_shell_interface = (strcmp(interface, "agl_shell") == 0);
37 -- 
38 2.39.2
39