Fwd: Hooking

Russell Shaw rjshaw at netspace.net.au
Fri Sep 9 19:54:09 PDT 2005


Tim Roberts wrote:
> ramalingareddy bommalapura wrote:
> 
>>          Can anybody please suggest how hooking can be done
>> in the xserver functions. XServer needs to invoke my function before
>> the call is passed to the XServer original function. I have found that
>> this is the procedure in windows for doing hooking:
> 
> X is entirely different from Windows.  The same internal concepts simply 
> do not apply.  What are you REALLY trying to do?  If you tell us your 
> real task, instead of how you think you need to solve it, perhaps one of 
> us can offer a real solution.
> 
> There are two aspects to X: client and server.  GUI programs (X clients) 
> call routines in Xlib to do drawing.  These are things like XDrawArc and 
> so on.  Xlib exists in the process of the GUI program.  It converts the 
> calls into messages that are transmitted over a socket to the X server, 
> which does the actual drawing.  The X server is a completely separate 
> process.  The messages are parsed, and eventually handed down to some 
> driver that does the drawing.
> 
> It is possible to insert a "tee" into the socket stream and split off a 
> second copy for yourself, but that means parsing the X protocol, not 
> handling APIs.

Page 583 of Xlib Programming Manual ISBN: 1565920023 explains hooking
into Xlib. Xlib is the client-side, not the X server side.



More information about the xorg mailing list