forked from enlightenment/enlightenment
force display to be [disp_name]:X.Y even if it is just [disp_name]:X
SVN revision: 12775
This commit is contained in:
parent
49ac422b1d
commit
2339d78f29
|
@ -63,6 +63,7 @@ main(int argc, char **argv)
|
||||||
int nowelcome = 0;
|
int nowelcome = 0;
|
||||||
int after_restart = 0;
|
int after_restart = 0;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
char *s;
|
||||||
|
|
||||||
/* for debugging by redirecting stdout of e to a log file to tail */
|
/* for debugging by redirecting stdout of e to a log file to tail */
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
setvbuf(stdout, NULL, _IONBF, 0);
|
||||||
|
@ -90,6 +91,29 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* fix up DISPLAY to be :N.0 if no .screen is in it */
|
||||||
|
s = getenv("DISPLAY");
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
p = strrchr(s, ':');
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "DISPLAY=%s:0.0", s);
|
||||||
|
putenv(buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = strrchr(p, '.');
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "DISPLAY=%s.0", s);
|
||||||
|
putenv(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* init edje and set it up in frozen mode */
|
/* init edje and set it up in frozen mode */
|
||||||
edje_init();
|
edje_init();
|
||||||
edje_freeze();
|
edje_freeze();
|
||||||
|
|
|
@ -53,6 +53,30 @@ int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
char *s, buf[1024];
|
||||||
|
|
||||||
|
/* fix up DISPLAY to be :N.0 if no .screen is in it */
|
||||||
|
s = getenv("DISPLAY");
|
||||||
|
if (s)
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
p = strrchr(s, ':');
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "DISPLAY=%s:0.0", s);
|
||||||
|
putenv(buf);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p = strrchr(p, '.');
|
||||||
|
if (!p)
|
||||||
|
{
|
||||||
|
snprintf(buf, sizeof(buf), "DISPLAY=%s.0", s);
|
||||||
|
putenv(buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* handle some command-line parameters */
|
/* handle some command-line parameters */
|
||||||
display_name = (const char *)getenv("DISPLAY");
|
display_name = (const char *)getenv("DISPLAY");
|
||||||
|
@ -100,7 +124,7 @@ main(int argc, char **argv)
|
||||||
if (!_e_ipc_init())
|
if (!_e_ipc_init())
|
||||||
{
|
{
|
||||||
printf("ERROR: Enlightenment_remote cannot set up the IPC socket.\n"
|
printf("ERROR: Enlightenment_remote cannot set up the IPC socket.\n"
|
||||||
"Maybe try the '-display :0' option?\n");
|
"Maybe try the '-display :0.0' option?\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue