blob: ba56e0520fe169cd8754eb99eebffe7e57c267b1 (
plain) (
blame)
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
|
--- ui/base/x/x11_cursor_loader.cc.orig 2025-10-21 16:57:35 UTC
+++ ui/base/x/x11_cursor_loader.cc
@@ -37,7 +37,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
@@ -79,7 +79,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 "";
@@ -224,7 +228,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(),
@@ -414,7 +418,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;
|