electron/patches/chromium/make_gtk_getlibgtk_public.patch
electron-roller[bot] d6c8ff2e70
chore: bump chromium to 119.0.6029.0 (main) (#39944)
* chore: bump chromium in DEPS to 119.0.6021.0

* 4727729: Initial ScreenCaptureKit AudioInputStream implementation

https://chromium-review.googlesource.com/c/chromium/src/+/4727729

* chore: fixup patch indices

* chore: bump chromium in DEPS to 119.0.6023.0

* 4875713: mac: Switch to Xcode 15.0 15A240d with macOS SDK 14.0 23A334

https://chromium-review.googlesource.com/c/chromium/src/+/4875713

* 4831380: [task-attribution] Reland: Move to an implicit GCed task container model

https://chromium-review.googlesource.com/c/chromium/src/+/4831380

* 4877868: Remove all gitignore entries for submodules

https://chromium-review.googlesource.com/c/chromium/src/+/4877868

* 4824705: Set origin to commit for data: URLs

https://chromium-review.googlesource.com/c/chromium/src/+/4824705

* chore: fixup patch indices

* 4881382: Expose selection in WebFormControlElement as unsigned

https://chromium-review.googlesource.com/c/chromium/src/+/4881382

* 4874216: Portals: Cancel drag-drop in predecessor before activation

https://chromium-review.googlesource.com/c/chromium/src/+/4874216

* chore: bump chromium in DEPS to 119.0.6025.0

* chore: bump chromium in DEPS to 119.0.6027.0

* 4884489: Update gitignore to be explicit about directories

https://chromium-review.googlesource.com/c/chromium/src/+/4884489

* 4881091: Add debug info about owner document's origin when inheriting

https://chromium-review.googlesource.com/c/chromium/src/+/4881091

* chore: fixup patch indices

* chore: bump chromium in DEPS to 119.0.6029.0

* chore: update patches

* 4881091: Add debug info about owner document's origin when inheriting

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4881091

* 4831380: [task-attribution] Reland: Move to an implicit GCed task container model

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4831380

* 4866732: Extract document.title for installable checks

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/4866732

* chore: link to crbug in message port test

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2023-09-28 22:26:41 -07:00

72 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Thu, 7 Apr 2022 20:30:16 +0900
Subject: Make gtk::GetLibGtk and gtk::GetLibGdkPixbuf public
Allows embedders to get a handle to the gtk and
gdk_pixbuf libraries already loaded in the process.
diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc
index d196e304a43191b6dc82f25b0b4bf24d242edb3c..85d618efa0574b00fc0cb1e5bde5ed725b2a90ab 100644
--- a/ui/gtk/gtk_compat.cc
+++ b/ui/gtk/gtk_compat.cc
@@ -66,11 +66,6 @@ void* GetLibGio() {
return libgio;
}
-void* GetLibGdkPixbuf() {
- static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
- return libgdk_pixbuf;
-}
-
void* GetLibGdk3() {
static void* libgdk3 = DlOpen("libgdk-3.so.0");
return libgdk3;
@@ -86,12 +81,6 @@ void* GetLibGtk4(bool check = true) {
return libgtk4;
}
-void* GetLibGtk() {
- if (GtkCheckVersion(4))
- return GetLibGtk4();
- return GetLibGtk3();
-}
-
bool LoadGtk3() {
if (!GetLibGtk3(false))
return false;
@@ -134,6 +123,17 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) {
} // namespace
+void* GetLibGdkPixbuf() {
+ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0");
+ return libgdk_pixbuf;
+}
+
+void* GetLibGtk() {
+ if (GtkCheckVersion(4))
+ return GetLibGtk4();
+ return GetLibGtk3();
+}
+
bool LoadGtk() {
static bool loaded = LoadGtkImpl();
return loaded;
diff --git a/ui/gtk/gtk_compat.h b/ui/gtk/gtk_compat.h
index 409e385fc952662c9887d9a810bb3c547c5be282..1518b681f98b3bc051aed74713a23c016c7b755e 100644
--- a/ui/gtk/gtk_compat.h
+++ b/ui/gtk/gtk_compat.h
@@ -40,6 +40,12 @@ using SkColor = uint32_t;
namespace gtk {
+// Get handle to the currently loaded gdk_pixbuf library in the process.
+void* GetLibGdkPixbuf();
+
+// Get handle to the currently loaded gtk library in the process.
+void* GetLibGtk();
+
// Loads libgtk and related libraries and returns true on success.
bool LoadGtk();