1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Bug fix: make -X,--display actually work, improve error message if display not found

This commit is contained in:
Cesare Tirabassi 2009-08-01 09:34:21 +02:00
parent 7ff2a71aa0
commit 01e66c7f8c
2 changed files with 6 additions and 6 deletions

View File

@ -9257,11 +9257,6 @@ void initialisation(int argc, char **argv) {
case 'a':
text_alignment = string_to_alignment(optarg);
break;
case 'X':
if (disp)
free(disp);
disp = strdup(optarg);
break;
#ifdef OWN_WINDOW
case 'o':
@ -9459,6 +9454,11 @@ int main(int argc, char **argv)
case 'w':
window.window = strtol(optarg, 0, 0);
break;
case 'X':
if (disp)
free(disp);
disp = strdup(optarg);
break;
#endif /* X11 */
case '?':

View File

@ -76,7 +76,7 @@ void init_X11(const char *disp)
{
if (!display) {
if ((display = XOpenDisplay(disp)) == NULL) {
CRIT_ERR(NULL, NULL, "can't open display: %s", XDisplayName(0));
CRIT_ERR(NULL, NULL, "can't open display: %s", XDisplayName(disp));
}
}