Hi all !
I am having a problem making my application work with Xvfb.
My application opens a file in a window and tries to print it. A
printer setup screen is popped up, which has an "APPLY" button and is
in focus. I generate the Enter key press event for this window. This
makes the opened file to be printed.
When the application is run with the display set to the X-server
running on my PC, it works fine.
If the same application is run with the display set to Xvfb running on
the Unix box, it doesn't take the key press event.
How do I pass the Enter key press event when i'm using Xvfb?
Xvfb is started using the command " Xvfb -pixdepths 24 -
co /usr/X11R6/lib/X11/rgb -fbdir /tmp +accessx"
I don't have the window ids of the Printer setup screen, so I'm using
this piece of code to pass the Enter Key press event. Apply button on
the Printer setup screen has the focus. Looks like this is not in focus
when using Xvfb.
.
.
.
XGetInputFocus(theDisplay, &child_return, &revert_to);
XQueryTree(theDisplay, child_return, &root_return,
&parent_return, &children, &nchildren);
for(i=0; i<index; i++)
{
printf("Using Window Id %d root Window %d\n", winArray
[i], rootArray[i]);
event.type=2;
event.xkey.type=2;
event.xkey.send_event=0;
event.xkey.state = 0;
event.xkey.display=theDisplay;
event.xkey.window=*children;
event.xkey.root=root_return;
event.xkey.keycode=35;
event.xkey.same_screen = 1;
XtDispatchEvent(&event);
}
.
.
.
Please let me know if there is any configuration issue that I have
missed.
Thanks in Advance,
Prashant.
Sent via Deja.com http://www.deja.com/
Before you buy.