electron/patches/chromium/introduce_ozoneplatform_ele...

38 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Marek Rusinowski <marekrusinowski@gmail.com>
Date: Wed, 23 Mar 2022 21:09:37 +0100
Subject: introduce OzonePlatform::electron_can_call_x11 property
We expose this additonal property in the OzonePlatform to be able to easily
determine whatever we can call X11 functions without crashing the application
at rutime. It would be best if eventually all usages of this property were
replaced with clean ozone native implementations.
diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
index 39e18820db0d0c1b57f4375e01d269e53c839e4e..ea4da67a9b7798822d1d5dd90d09597aa658e79e 100644
--- a/ui/ozone/platform/x11/ozone_platform_x11.cc
+++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
@@ -193,6 +193,7 @@ class OzonePlatformX11 : public OzonePlatform,
base::MessagePumpType::UI;
properties->supports_vulkan_swap_chain = true;
properties->skia_can_fall_back_to_x11 = true;
+ properties->electron_can_call_x11 = true;
properties->platform_shows_drag_image = false;
properties->supports_global_application_menus = true;
properties->app_modal_dialogs_use_event_blocker = true;
diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
index 9d6534449f04baa7ebfc8604286b7d5f230e259a..cf23a05ee0a49f397b3605fb1e4510a86b40885d 100644
--- a/ui/ozone/public/ozone_platform.h
+++ b/ui/ozone/public/ozone_platform.h
@@ -122,6 +122,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
// Linux only: determines if Skia can fall back to the X11 output device.
bool skia_can_fall_back_to_x11 = false;
+ // Linux only: determines is Electron can call selected X11 functions while
+ // it migrates to pure ozone abstractions.
+ bool electron_can_call_x11 = false;
+
// Wayland only: determines whether windows which are not top level ones
// should be given parents explicitly.
bool set_parent_for_non_top_level_windows = false;