aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjohnmartin-oracle <55413843+johnmartin-oracle@users.noreply.github.com>2020-08-27 22:30:40 -0400
committerGitHub <noreply@github.com>2020-08-27 22:30:40 -0400
commit3c63c5e74065bac363835ca7c6cdd40445248357 (patch)
tree2f0e41d5e44044b7f54349a621fbaedab5e38f3f
parentac76a87b7feaf2bab0e5db693ef68004f5e3b545 (diff)
parent7ab92639848a6059e2b6b88499b008b9606f3af6 (diff)
downloadtigervnc-3c63c5e74065bac363835ca7c6cdd40445248357.tar.gz
tigervnc-3c63c5e74065bac363835ca7c6cdd40445248357.zip
Merge pull request #1 from johnmartin-oracle/johnmartin-oracle-patch-1
Update Surface_X11.cxx
-rw-r--r--vncviewer/Surface_X11.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/vncviewer/Surface_X11.cxx b/vncviewer/Surface_X11.cxx
index 6562634d..8944c3f7 100644
--- a/vncviewer/Surface_X11.cxx
+++ b/vncviewer/Surface_X11.cxx
@@ -123,17 +123,17 @@ void Surface::alloc()
// we find such a format
templ.type = PictTypeDirect;
templ.depth = 32;
-#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- templ.direct.alpha = 0;
- templ.direct.red = 8;
- templ.direct.green = 16;
- templ.direct.blue = 24;
-#else
- templ.direct.alpha = 24;
- templ.direct.red = 16;
- templ.direct.green = 8;
- templ.direct.blue = 0;
-#endif
+ if (XImageByteOrder(fl_display) == MSBFirst) {
+ templ.direct.alpha = 0;
+ templ.direct.red = 8;
+ templ.direct.green = 16;
+ templ.direct.blue = 24;
+ } else {
+ templ.direct.alpha = 24;
+ templ.direct.red = 16;
+ templ.direct.green = 8;
+ templ.direct.blue = 0;
+ }
templ.direct.alphaMask = 0xff;
templ.direct.redMask = 0xff;
templ.direct.greenMask = 0xff;