forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_gtk_getlibgdkpixbuf_public.patch
50 lines (42 loc) · 1.52 KB
/
make_gtk_getlibgdkpixbuf_public.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Date: Wed, 15 Jun 2022 17:59:18 +0000
Subject: Make gtk::GetLibGdkPixbuf public
Allows Electron to fetch libgdk_pixbuf during run-time
rather than having to link to it statically.
diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc
index 40b706ed7cde206e98274025148604760b7477f9..65b097cfab72b92f301968715eb218ef0e468567 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;
@@ -128,6 +123,11 @@ 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();
diff --git a/ui/gtk/gtk_compat.h b/ui/gtk/gtk_compat.h
index 2245974f91be4a691d82f54b55e12e44ae2000c5..37720be9e393d192b3b7db13a007431a9ce77ddc 100644
--- a/ui/gtk/gtk_compat.h
+++ b/ui/gtk/gtk_compat.h
@@ -34,6 +34,9 @@ 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();