mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fix crash when libX11 is missing locale support (#2747)
This commit is contained in:
parent
806b629035
commit
4d5db9940f
@ -1757,10 +1757,12 @@ namespace dlib
|
||||
// it isn't const anymore.
|
||||
wchar_t *title = const_cast<wchar_t *>(title_.c_str());
|
||||
XTextProperty property;
|
||||
XwcTextListToTextProperty(x11_stuff.globals->disp,&title,1,XStdICCTextStyle, &property);
|
||||
XSetWMName(x11_stuff.globals->disp,x11_stuff.hwnd,&property);
|
||||
XFree(property.value);
|
||||
XFlush(x11_stuff.globals->disp);
|
||||
int rc = XwcTextListToTextProperty(x11_stuff.globals->disp,&title,1,XStdICCTextStyle, &property);
|
||||
if (rc >= 0) {
|
||||
XSetWMName(x11_stuff.globals->disp,x11_stuff.hwnd,&property);
|
||||
XFree(property.value);
|
||||
XFlush(x11_stuff.globals->disp);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user