-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11/mlterm: Fix color of sixel image on X server of opposite byte-order.
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
Showing
3 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); |