XevieSendEvent events not arriving

Heinrich Janzing heinrich.janzing at student.kuleuven.be
Sun Feb 18 08:15:02 PST 2007


I tried intercepting events and just sending them with XevieSendEvent and 
XEVIE_MODIFIED without actually modifying them, and this seemed to work fine. 
So appearently I'm doing some part of the modification wrong. I tried setting 
time to CurrentTime and subwindow to None but that didn't seem to matter. 
Especially in this simple case (testing on xev's main window - the hit.window 
and the relative x and y coordinates appear to be correct) the event data 
seems pretty correct to me (and it does work with the XSendEvent statement 

I really need some help with this! I tried looking at the xorg code to see 
what actually happens when you use XevieSendEvent... but my attempts to fully 
understand the code were... futile.

Any help solving or understanding this problem is _greatly_ appreciated.

On Wednesday 07 February 2007 22:21:23 Heinrich Janzing wrote:
> 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
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg

More information about the xorg mailing list