diff options
| author | Joel Klinghed <the_jk@opera.com> | 2017-09-27 10:51:23 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@opera.com> | 2017-09-27 10:51:23 +0200 |
| commit | 69031e2a0097b2367205b88e038026c56cda3471 (patch) | |
| tree | 711e147a2a5c3840b281d7ed118e9117ec72a4ac /src | |
| parent | 5e90e8786a089930d49adce5696508cc959a6045 (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 :/
Diffstat (limited to 'src')
| -rw-r--r-- | src/x.cc | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) { |
