From bdd628d7b761abdf611fa1feb5147707c886fa28 Mon Sep 17 00:00:00 2001 From: rin Date: Sat, 2 Jul 2022 03:17:04 +0000 Subject: [PATCH] x11/mlterm: Fix color of sixel image on X server of opposite byte-order. This patch has been pull-requested to upstream: https://github.com/arakiken/mlterm/pull/45 Bump revision. --- x11/mlterm/Makefile | 4 +- x11/mlterm/distinfo | 3 +- .../patch-uitoolkit_xlib_ui__imagelib.c | 45 +++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c diff --git a/x11/mlterm/Makefile b/x11/mlterm/Makefile index d79016bbe87a..f6856dde06e5 100644 --- a/x11/mlterm/Makefile +++ b/x11/mlterm/Makefile @@ -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} diff --git a/x11/mlterm/distinfo b/x11/mlterm/distinfo index 923d7cfdbf0d..cd8824457182 100644 --- a/x11/mlterm/distinfo +++ b/x11/mlterm/distinfo @@ -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 diff --git a/x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c b/x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c new file mode 100644 index 000000000000..084d98a65ebf --- /dev/null +++ b/x11/mlterm/patches/patch-uitoolkit_xlib_ui__imagelib.c @@ -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)));