aboutsummaryrefslogtreecommitdiff
path: root/devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc
diff options
context:
space:
mode:
Diffstat (limited to 'devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc')
-rw-r--r--devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc41
1 files changed, 41 insertions, 0 deletions
diff --git a/devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc b/devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc
new file mode 100644
index 000000000000..dc88ff4c8201
--- /dev/null
+++ b/devel/electron29/files/patch-ui_base_x_x11__cursor__loader.cc
@@ -0,0 +1,41 @@
+--- ui/base/x/x11_cursor_loader.cc.orig 2024-02-21 00:21:15 UTC
++++ ui/base/x/x11_cursor_loader.cc
+@@ -31,7 +31,7 @@
+ #include "ui/gfx/x/connection.h"
+ #include "ui/gfx/x/xproto.h"
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ #include "ui/linux/linux_ui.h"
+ #endif
+
+@@ -137,7 +137,11 @@ std::string CursorPathFromLibXcursor() {
+ void operator()(void* ptr) const { dlclose(ptr); }
+ };
+
++#if BUILDFLAG(IS_BSD)
++ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so", RTLD_LAZY));
++#else
+ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so.1", RTLD_LAZY));
++#endif
+ if (!lib)
+ return "";
+
+@@ -248,7 +252,7 @@ scoped_refptr<base::RefCountedMemory> ReadCursorFile(
+ const std::string& rm_xcursor_theme) {
+ constexpr const char kDefaultTheme[] = "default";
+ std::string themes[] = {
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // The toolkit theme has the highest priority.
+ LinuxUi::instance() ? LinuxUi::instance()->GetCursorThemeName()
+ : std::string(),
+@@ -440,7 +444,7 @@ uint32_t XCursorLoader::GetPreferredCursorSize() const
+ return size;
+ }
+
+-#if BUILDFLAG(IS_LINUX)
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
+ // Let the toolkit have the next say.
+ auto* linux_ui = LinuxUi::instance();
+ size = linux_ui ? linux_ui->GetCursorThemeSize() : 0;