From 6fe411ea9ebdec1bf4b2a8cf0f12d67361c47efc Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 26 Nov 2016 06:39:37 +0100 Subject: [PATCH] fix(ewmh): Include last desktop name --- src/x11/ewmh.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/x11/ewmh.cpp b/src/x11/ewmh.cpp index 91301755..560f6db1 100644 --- a/src/x11/ewmh.cpp +++ b/src/x11/ewmh.cpp @@ -87,8 +87,9 @@ namespace ewmh_util { vector names; char buffer[BUFSIZ]; + size_t len{0}; - for (size_t n = 0, len = 0; n < reply.strings_len; n++) { + for (size_t n = 0; n < reply.strings_len; n++) { if (reply.strings[n] == '\0') { names.emplace_back(buffer, len); len = 0; @@ -97,6 +98,10 @@ namespace ewmh_util { } } + if (len) { + names.emplace_back(buffer, len); + } + return names; }