Skip to content

Commit

Permalink
x11/mlterm: Fix color of sixel image on X server of opposite byte-order.
Browse files Browse the repository at this point in the history
This patch has been pull-requested to upstream:
arakiken/mlterm#45

Bump revision.
  • Loading branch information
rin committed Jul 2, 2022
1 parent 29a1f59 commit bdd628d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x11/mlterm/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.170 2022/04/18 19:12:24 adam Exp $
# $NetBSD: Makefile,v 1.171 2022/07/02 03:17:04 rin Exp $

DISTNAME= mlterm-3.9.2
DIST_SUBDIR= ${PKGNAME_NOREV} # for re-tagged 3.9.2
PKGREVISION= 1
PKGREVISION= 2
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_GITHUB:=arakiken/}
GITHUB_PROJECT= ${PKGBASE}
Expand Down
3 changes: 2 additions & 1 deletion x11/mlterm/distinfo
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
$NetBSD: distinfo,v 1.90 2022/01/18 14:38:34 tsutsui Exp $
$NetBSD: distinfo,v 1.91 2022/07/02 03:17:04 rin Exp $

BLAKE2s (mlterm-3.9.2/mlterm-3.9.2.tar.gz) = 3bd490eb661bc802cb05ebbb17a73956f5a62ca3838dcf5cb7baad0c01c3ebdb
SHA512 (mlterm-3.9.2/mlterm-3.9.2.tar.gz) = 3076dafbc98a01738d88acf0e0f52e15d33862b3e9b7a851a4496f1be07ee9e51103daf7842954bcae1f1ba62bd6645b0bd60af7f66ee98721bdf3786b9fcbaf
Size (mlterm-3.9.2/mlterm-3.9.2.tar.gz) = 4259208 bytes
SHA1 (patch-configure) = 266b3e8383c425c7ef8cd180f07e1199890521ba
SHA1 (patch-etc_font-fb) = 52c18f512c67ff530c0c326394fdf43956d71cb0
SHA1 (patch-uitoolkit_xlib_ui__imagelib.c) = 310558eb0796486aa1d2acab2c9e9a2d204ce0f0
SHA1 (patch-vtemu_Makefile.in) = 172f12f73408489f782d63c8b0b7915af441d368
45 changes: 45 additions & 0 deletions x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
$NetBSD: patch-uitoolkit_xlib_ui__imagelib.c,v 1.3 2022/07/02 03:17:04 rin Exp $

Fix color of sixel image on X server whose byte-order is opposite to client.

This patch has been pull-requested to upstream:
https://github.com/arakiken/mlterm/pull/45

--- uitoolkit/xlib/ui_imagelib.c.orig 2022-07-02 10:56:15.200011767 +0900
+++ uitoolkit/xlib/ui_imagelib.c 2022-07-02 10:58:10.298442685 +0900
@@ -580,6 +580,11 @@ static int load_sixel(ui_display_t *disp
image = XCreateImage(disp->display, disp->visual, disp->depth, ZPixmap, 0, data, w, h,
/* in case depth isn't multiple of 8 */
bytes_per_pixel * 8, w * bytes_per_pixel);
+#ifdef WORDS_BIGENDIAN
+ image->byte_order = MSBFirst;
+#else
+ image->byte_order = LSBFirst;
+#endif

*pixmap = XCreatePixmap(disp->display, ui_display_get_group_leader(disp), w, h, disp->depth);

@@ -944,6 +949,11 @@ static XImage *pixbuf_to_ximage_truecolo

return NULL;
}
+#ifdef WORDS_BIGENDIAN
+ image->byte_order = MSBFirst;
+#else
+ image->byte_order = LSBFirst;
+#endif

/* set num of bytes per pixel of pixbuf */
bytes_per_pixel = (gdk_pixbuf_get_has_alpha(pixbuf)) ? 4 : 3;
@@ -1617,6 +1627,11 @@ Pixmap ui_imagelib_get_transparent_backg

return None;
}
+#ifdef WORDS_BIGENDIAN
+ image->byte_order = MSBFirst;
+#else
+ image->byte_order = LSBFirst;
+#endif

vinfo_template.visualid =
XVisualIDFromVisual(DefaultVisual(win->disp->display, DefaultScreen(win->disp->display)));

0 comments on commit bdd628d

Please sign in to comment.