summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2017-09-27 10:51:23 +0200
committerJoel Klinghed <the_jk@opera.com>2017-09-27 10:51:23 +0200
commit69031e2a0097b2367205b88e038026c56cda3471 (patch)
tree711e147a2a5c3840b281d7ed118e9117ec72a4ac
parent5e90e8786a089930d49adce5696508cc959a6045 (diff)
Improve x::get_best_format
Allow bits_per_rgb_value to be >= 8 Pick the first matched depth. Ended up matching a 32 bit depth (TrueColor) as all 24 bit depths (DirectColor) as they used 11 bits per rgb value. The screen did not support creating a window with depth 32 depth :/
-rw-r--r--src/x.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/x.cc b/src/x.cc
index d5bdd5a..53b09d4 100644
--- a/src/x.cc
+++ b/src/x.cc
@@ -221,7 +221,7 @@ Format get_best_format(xcb_connection_t* conn, xcb_screen_t const* screen,
continue;
}
PixelFormat f;
- if (v->bits_per_rgb_value != 8) continue;
+ if (v->bits_per_rgb_value < 8) continue;
if (v->red_mask == 0xff0000 && v->green_mask == 0xff00
&& v->blue_mask == 0xff) {
f = ARGB_8888;
@@ -258,6 +258,7 @@ Format get_best_format(xcb_connection_t* conn, xcb_screen_t const* screen,
}
if (render) break;
}
+ if (visual && (!render_formats || render)) break;
xcb_depth_next(&iter);
}
if (!depth) {