Commit 4e042751 authored by Davis King's avatar Davis King

Fixed the native font object so that it can find the X11 display

on Mac OS X even when the application is run outside an xterm.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402431
parent a5a0e114
......@@ -335,6 +335,15 @@ namespace nativefont
setlocale(LC_CTYPE, "");
if (d == NULL){
d = XOpenDisplay(NULL);
if (d == 0)
{
d = XOpenDisplay(":0.0");
if (d == 0)
{
throw dlib::gui_error("Unable to connect to the X display.");
}
}
cmap = DefaultColormap(d, DefaultScreen(d));
}
char fontset[256];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment