From 5e90e8786a089930d49adce5696508cc959a6045 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 27 Sep 2017 10:36:55 +0200 Subject: Fix x::get_best_format --- src/x.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/x.cc b/src/x.cc index 4af1230..d5bdd5a 100644 --- a/src/x.cc +++ b/src/x.cc @@ -202,9 +202,15 @@ Format get_best_format(xcb_connection_t* conn, xcb_screen_t const* screen, auto iter = xcb_screen_allowed_depths_iterator(screen); while (count--) { auto d = iter.data; - if (d->depth <= depth) continue; + if (d->depth <= depth) { + xcb_depth_next(&iter); + continue; + } auto visuals_count = xcb_depth_visuals_length(d); - if (visuals_count == 0) continue; + if (visuals_count == 0) { + xcb_depth_next(&iter); + continue; + } auto v = xcb_depth_visuals(d); for (; visuals_count--; ++v) { switch (v->_class) { -- cgit v1.3