forked from e16/e16
1
0
Fork 0

Fix restart (broken in 1.0.6).

SVN revision: 53931
This commit is contained in:
Kim Woelders 2010-10-27 17:47:35 +00:00
parent 4e4a1a3096
commit 3cec1775de
2 changed files with 8 additions and 3 deletions

View File

@ -51,7 +51,7 @@ SetupX(const char *dstr)
if (!dstr)
dstr = getenv("DISPLAY");
if (!dstr)
dstr = ":0";
dstr = ":0.0";
/* Open a connection to the diplay nominated by the DISPLAY variable */
err = EDisplayOpen(dstr, Dpy.screen);

View File

@ -1702,6 +1702,9 @@ EDisplayOpen(const char *dstr, int scr)
char dbuf[256], *s;
unsigned int ddpy, dscr;
if (!dstr)
goto do_open;
Esnprintf(dbuf, sizeof(dbuf), "%s", dstr);
s = strchr(dbuf, ':');
if (!s)
@ -1713,12 +1716,14 @@ EDisplayOpen(const char *dstr, int scr)
if (scr >= 0) /* Override screen */
dscr = scr;
Esnprintf(s, sizeof(dbuf) - (s - dbuf), "%u.%u", ddpy, dscr);
dstr = dbuf;
do_open:
#ifdef USE_ECORE_X
ecore_x_init(dbuf);
ecore_x_init(dstr);
disp = ecore_x_display_get();
#else
disp = XOpenDisplay(dbuf);
disp = XOpenDisplay(dstr);
#endif
return (disp) ? 0 : -1;