- Improved Open Display function in kintox11 to retry for 1 minute, may be helpful in some distro configs.

This commit is contained in:
Ben Reaves
2020-02-11 17:29:05 -06:00
parent 2179176881
commit ab679ddf9d
2 changed files with 13 additions and 2 deletions

Binary file not shown.

View File

@@ -59,9 +59,20 @@ int strcicmp(char const *a, char const *b)
} }
Display* open_display(){ Display* open_display(){
int i;
Display* d = XOpenDisplay(NULL); Display* d = XOpenDisplay(NULL);
for (i = 0; i < 60; i++) {
if(d == NULL){
printf("fail to open X server display...\n");
}
else{
break;
}
sleep(1);
}
if(d == NULL){ if(d == NULL){
printf("fail to open X server display...\n"); printf("fail to open X server display for 1 minute...\n");
printf("Kintox11 is now exiting...\n");
exit(1); exit(1);
} }
return d; return d;
@@ -109,7 +120,7 @@ Window get_top_window(Display* d, Window start){
XFree(children); XFree(children);
if(xerror){ if(xerror){
printf("fail to get top window: %d\n",w); printf("fail to get top window: %ld\n",w);
exit(1); exit(1);
} }