projects/guix·blob java-team · refs

37 lines · 1.2 KiB

1From: Danny Milosavljevic <[email protected]>
2Date: Thu, 2 Apr 2022 12:10:00 +0200
3Subject: Make xterm use libxcursor directly
4
5Fixes <https://issues.guix.gnu.org/54654>.
6
7This patch makes xterm use libxcursor directly.
8Without it, libx11 would try to dlopen("libXcursor.so.1") and fail.
9
10--- xterm-370/misc.c.orig 2022-04-02 11:52:26.225131854 +0200
11+++ xterm-370/misc.c 2022-04-02 12:06:13.091482385 +0200
12@@ -79,6 +79,9 @@
13 #ifdef HAVE_LIBXPM
14 #include <X11/xpm.h>
15 #endif
16+#ifdef HAVE_LIB_XCURSOR
17+#include <X11/Xcursor/Xcursor.h>
18+#endif
19
20 #ifdef HAVE_LANGINFO_CODESET
21 #include <langinfo.h>
22@@ -866,7 +869,14 @@
23 * 0, 2 a shape, 3 a mask for 2, etc. <X11/cursorfont.h>
24 * contains defined names for each shape.
25 */
26- c = XCreateGlyphCursor(dpy,
27+ c = XcursorTryShapeCursor(dpy,
28+ myFont.fs->fid, /* source_font */
29+ myFont.fs->fid, /* mask_font */
30+ c_index + 0, /* source_char */
31+ c_index + 1, /* mask_char */
32+ &foreground,
33+ &background);
34+ if (c == None) c = XCreateGlyphCursor(dpy,
35 myFont.fs->fid, /* source_font */
36 myFont.fs->fid, /* mask_font */
37 c_index + 0, /* source_char */