introduce_ozoneplatform_electron_can_call_x11_property.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Marek Rusinowski <[email protected]>
  3. Date: Wed, 23 Mar 2022 21:09:37 +0100
  4. Subject: introduce OzonePlatform::electron_can_call_x11 property
  5. We expose this additonal property in the OzonePlatform to be able to easily
  6. determine whatever we can call X11 functions without crashing the application
  7. at rutime. It would be best if eventually all usages of this property were
  8. replaced with clean ozone native implementations.
  9. diff --git a/ui/ozone/platform/x11/ozone_platform_x11.cc b/ui/ozone/platform/x11/ozone_platform_x11.cc
  10. index 39e18820db0d0c1b57f4375e01d269e53c839e4e..ea4da67a9b7798822d1d5dd90d09597aa658e79e 100644
  11. --- a/ui/ozone/platform/x11/ozone_platform_x11.cc
  12. +++ b/ui/ozone/platform/x11/ozone_platform_x11.cc
  13. @@ -193,6 +193,7 @@ class OzonePlatformX11 : public OzonePlatform,
  14. base::MessagePumpType::UI;
  15. properties->supports_vulkan_swap_chain = true;
  16. properties->skia_can_fall_back_to_x11 = true;
  17. + properties->electron_can_call_x11 = true;
  18. properties->platform_shows_drag_image = false;
  19. properties->supports_global_application_menus = true;
  20. properties->app_modal_dialogs_use_event_blocker = true;
  21. diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h
  22. index b2550902614dec6903d7f8740e8557d2da7b7be9..ba4ef7e230e1bcc752f22a3140b86b0e69e5335f 100644
  23. --- a/ui/ozone/public/ozone_platform.h
  24. +++ b/ui/ozone/public/ozone_platform.h
  25. @@ -128,6 +128,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
  26. // Linux only: determines if Skia can fall back to the X11 output device.
  27. bool skia_can_fall_back_to_x11 = false;
  28. + // Linux only: determines is Electron can call selected X11 functions while
  29. + // it migrates to pure ozone abstractions.
  30. + bool electron_can_call_x11 = false;
  31. +
  32. // Wayland only: determines whether windows which are not top level ones
  33. // should be given parents explicitly.
  34. bool set_parent_for_non_top_level_windows = false;