summaryrefslogtreecommitdiff
path: root/src/x.cc
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@opera.com>2017-09-27 10:36:55 +0200
committerJoel Klinghed <the_jk@opera.com>2017-09-27 10:36:55 +0200
commit5e90e8786a089930d49adce5696508cc959a6045 (patch)
treed8877478a44cf71b0fc89c2f45a08f9b0d2e5c52 /src/x.cc
parenta19cd9ffe6193dd798bee46b6c0cf30dc1ac3ab3 (diff)
Fix x::get_best_format
Diffstat (limited to 'src/x.cc')
-rw-r--r--src/x.cc10
1 files 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) {