[Xcb] How to use xcb_icccm

Micah Nordland mpnordland at gmail.com
Sat Nov 24 16:43:08 PST 2012


well, I tried what you suggested, and now I either get nothing, or
something like this:
`:N`�



On Sat, Nov 24, 2012 at 5:59 PM, Michael Stapelberg <
michael+xcb at stapelberg.de> wrote:

> Hi Micah,
>
> Micah Nordland <mpnordland at gmail.com> writes:
> > std::string Window::getWMName()
> > {
> >     //xcb_generic_error_t e;
> >     xcb_icccm_get_text_property_reply_t prop;
> >     xcb_get_property_cookie_t cookie =
> > xcb_icccm_get_wm_name_unchecked(globalconf.conn, id);
> >     xcb_icccm_get_wm_name_reply(globalconf.conn, cookie, &prop, NULL);
> >     std::string name = prop.name;
> >     return name;
> > }
> >
> > and when I try to out put the name, I get this:
> > This is the window's name <garbage characters>
> Without actually testing it, I suspect that you need to consider
> name_len as the reply is not NUL-terminated:
>
>     char *name;
>     asprintf(&name, "%.*s", prop.name_len, prop.name);
>
> --
> Best regards,
> Michael
>



-- 
Praising my Savior all the day long,
Micah Nordland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20121124/3d224d15/attachment.html>


More information about the Xcb mailing list