XevieSendEvent events not arriving

Heinrich Janzing heinrich.janzing at student.kuleuven.be
Wed Feb 7 13:21:23 PST 2007


Hi,

I tried getting help on the xevie mailing list, but got no answer...  
so here goes...

If I try to send modified/synthetic events using Xevie they don't seem  
to arrive (tested using xev). Here is a piece of my code:

const PointerStatus& ps = Settings::getEventHandler()->getPointerStatus();
        Vector objCoords = Settings::getRenderer()->unproject(ps.screenX,  
ps.screenY, this);

        XWindowHit hit = findXWindowAt((int) objCoords.x, (int) objCoords.y);
#ifdef VERBOSE
        if (hit.window != None)
                cout << "Found X window at click location!" << endl;
#endif

        if (hit.window != None)
        {
                XButtonEvent changedEvent = event;
                changedEvent.window = hit.window;
                changedEvent.x = hit.relX;
                changedEvent.y = hit.relY;
                if (XevieSendEvent(Settings::getDisplay(),  
reinterpret_cast<XEvent*>(&changedEvent), XEVIE_MODIFIED))
                        cout << "XevieSendEvent success!" << endl;
                else
                        cout << "XevieSendEvent failed!" << endl;
                //XSendEvent(Settings::getDisplay(), hit.window, true,  
NoEventMask,  
reinterpret_cast<XEvent*>(&changedEvent));

                Window currFocus;
                int revertTo;
                XGetInputFocus(Settings::getDisplay(), &currFocus, &revertTo);
                if (currFocus != hit.window)
                        XSetInputFocus(Settings::getDisplay(),  
hit.window, RevertToParent,  
CurrentTime);
        }

event is the original event captured through Xevie. If I use the  
XSendEvent statement instead of the XevieSendEvent the events do  
arrive, but with the synthetic flag. So what am I doing wrong? It  
seems to be very hard to find specific and detailed information on  
Xevie. What fields of the event record do I need to fill in and which  
ones are automatically filled in?

Thanks,

Heinrich



More information about the xorg mailing list