Hi all:
        I have some problems to make XGetInputFocus work...
        this core compiles.. with
g++ -I/usr/local/include  -g -I/usr/X11R6/include  -L/usr/local/lib  -lX11 
-L/usr/X11R6/lib xtest.c
        but it gives out core dump when runs, after tracing a while, it is 
somewhere inside the API XGetInputFocus. Can someone give me a hand???
        Thanks!!!

regards
leo

-------------------------------------
//xtest.c

//X includes
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xlibint.h>
#include <X11/extensions/XInput.h>
#include <X11/extensions/XI.h>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;
int main(int argc, char **argv){
        char * DisplayName= NULL;
        int i=0;
        Display * dpy=NULL;
        Window * w=NULL;
        int* ts=NULL;
        //get the displayname
        if (argc>1) {
                for (i=1; i<argc; i++) {
                 if (strcmp(argv[i], "-display")==0|| strcmp(argv[i], "--display")==0) 
{
                         i++;
                         if (i>=argc) {
                                 printf(("too few arguments for %s"), argv[i-1]);
                                 exit(1);
                         }
                         DisplayName = argv[i];
                 }
                }
        }
        //init X connection
        dpy =XOpenDisplay(DisplayName);
        //I am sure the dpy* is not null here!!
        if (dpy){
                  //core dump!!
        XGetInputFocus(dpy, w,&re);
        }
        return 0;
}

_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to