From de36918beb0fb45aedd326aa3343bc9e98b6381a Mon Sep 17 00:00:00 2001 From: tsic404 Date: Wed, 1 Mar 2023 12:16:15 +0800 Subject: [PATCH] fix: fix get a longer name then it actually is fix https://github.com/linuxdeepin/developer-center/issues/3763 xcb_ewmh_get_wm_name return full string is longer than wm name, get the same str as the wm name log: --- src/lib/xcbutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/xcbutils.cpp b/src/lib/xcbutils.cpp index 218fb6b..279843a 100644 --- a/src/lib/xcbutils.cpp +++ b/src/lib/xcbutils.cpp @@ -359,7 +359,7 @@ std::string XCBUtils::getWMName(XWindow xid) xcb_get_property_cookie_t cookie = xcb_ewmh_get_wm_name(&m_ewmh, xid); xcb_ewmh_get_utf8_strings_reply_t reply; if (xcb_ewmh_get_wm_name_reply(&m_ewmh, cookie, &reply, nullptr)) { - ret.assign(reply.strings); + ret.assign(reply.strings, reply.strings_len); // 释放utf8_strings_reply分配的内存 xcb_ewmh_get_utf8_strings_reply_wipe(&reply); } else {