diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/c/stuff.xs.pl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index c9477dae5..2e80b0998 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -159,8 +159,17 @@ Xtest(display) if ((pid = fork()) == 0) { Display *d = XOpenDisplay(display); if (d) { - XSetCloseDownMode(d, RetainPermanent); - XCloseDisplay(d); + int child; + /* keep a client until some window is created, otherwise X server blinks to hell */ + if ((child = fork()) == 0) { + XEvent event; + XSelectInput(d, DefaultRootWindow(d), SubstructureNotifyMask); + do { + XNextEvent(d, &event); + } while (event.type != CreateNotify); + XCloseDisplay(d); + exit(0); + } } _exit(d != NULL); } |