Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!sanjeev
From: sanjeev@psuvax1.cs.psu.edu (Sanjeev Y. Dharap)
Newsgroups: comp.windows.x
Subject: XSendEvent
Message-ID: 
Date: 13 Aug 89 19:39:54 GMT
Sender: sanjeev@psuvax1.cs.psu.edu (Sanjeev Y. Dharap)
Distribution: comp
Organization: Penn State University Computer Science
Lines: 48



Is there anyone out there who has actually used XSendEvent
effectively?

I have been trying to use it without results. If a client sends an
event to itself, using XSendEvent, it works perfectly. On the other
hand, if I do something like this...





if(fork()==0)
	child();



...

and child() contains

child(){
   XEvent send_event;
   int k;

   send_event.type = KeyPress;
   do{
      sleep(5);
      printf("Sending..");
      k = XSendEvent(display,window,False,KeyPressMask,&send_event);
      printf(".returns %d\n",k);
   }while(1);

}/* end child */

then this bombs. The child process keeps printing the messages, but
sends no event. (I print out the events in the parent.)

Can someone help me? There's very little documentation on XSendEvent.

Any hints, pointers will be greatly appreciated.

Thanx.

sanjeev.

sanjeev@psuvax1.cs.psu.edu