Update unix_event_emitter.cpp

develop
Jan Boon 4 years ago committed by GitHub
parent 850b8e0158
commit 396f0d808e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -699,22 +699,21 @@ bool CUnixEventEmitter::processMessage (XEvent &event, CEventServer *server)
if (XGetWindowProperty(_dpy, _win, XA_NEL_SEL, 0, XMaxRequestSize(_dpy), False, AnyPropertyType, &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char**)&data) != Success) if (XGetWindowProperty(_dpy, _win, XA_NEL_SEL, 0, XMaxRequestSize(_dpy), False, AnyPropertyType, &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char**)&data) != Success)
return false; return false;
ucstring text; std::string text = (const char*)data;
std::string tmpData = (const char*)data;
XFree(data); XFree(data);
// convert buffer to ucstring // convert buffer to ucstring
if (target == XA_UTF8_STRING) if (target == XA_UTF8_STRING)
{ {
text = ucstring::makeFromUtf8(tmpData); // OK
} }
else if (target == XA_STRING) else if (target == XA_STRING)
{ {
text = tmpData; // FIXME: Convert local to UTF-8
} }
else else
{ {
nlwarning("Unknow format %u", (uint)target); nlwarning("Unknown format %u", (uint)target);
} }
// sent string event to event server // sent string event to event server

Loading…
Cancel
Save