summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-26 12:33:25 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-26 12:33:25 +0000
commitc555b06d0fcb2baa3c642698f43cb6264413ef22 (patch)
tree950d48ca53e40c6b0d2cb21fda2cdfeac2926a30
parentdabd6884195d47a85acbf3c751f573c6da1752e8 (diff)
downloaddrakx-c555b06d0fcb2baa3c642698f43cb6264413ef22.tar
drakx-c555b06d0fcb2baa3c642698f43cb6264413ef22.tar.gz
drakx-c555b06d0fcb2baa3c642698f43cb6264413ef22.tar.bz2
drakx-c555b06d0fcb2baa3c642698f43cb6264413ef22.tar.xz
drakx-c555b06d0fcb2baa3c642698f43cb6264413ef22.zip
inspires from xwait: keep a client until some window is created, otherwise X server blinks to hell
-rw-r--r--perl-install/c/stuff.xs.pl13
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);
}