dix and Xprint

Adam Jackson ajax at redhat.com
Fri Mar 14 13:13:05 PDT 2008


On Fri, 2008-03-14 at 14:27 -0400, Eamon Walsh wrote:
> Adam Jackson wrote:
> > On Wed, 2008-03-12 at 10:59 +1100, Drew Parsons wrote:
> >> Finally, about requestingClient itself, it's only used to obtain a print
> >> context via XpGetPrintContext(requestingClient).  Is there any other API
> >> to get the identity of the client making a request, other than
> >> requestingClient?  If there were, we could potentially clear out these
> >> xprintisms from dix completely with just a handful of changes in
> >> xprint/ps (well, there'd still be the usage in dixfont.c to think
> >> about).
> >
> > Probably the right way to do this now is to hook yourself into the
> > XaceHookDispatch() call chain during XpExtensionInit(), and stash the
> > current client aside in a field in the XpScreenRec (or in some bit of
> > global server state really).
> 
> Maybe this is a dumb question, but isn't the right way to get the 
> requesting client simply to look at the "client" argument that gets 
> passed in to the protocol dispatch function?  Where is it getting lost here?

It's not a dumb question, Xprint is just a dumb protocol.

The issue is that Xprint needs to get the output resolution in the
context of the client requesting the print job, but by the time it needs
this information it's way down in a PutImage call (or something else in
the font path that I'm too disgusted to untangle all the way).  So
you're already in GC decomposition by this point, far far away from the
dispatch layer where you'd normally have access to the ClientRec.

I suppose if you really wanted to do this cleanly, you'd do it by
stashing the XpContextRec off the GC instead of off the client.  Though
that probably changes the semantics of the print protocol in subtle
ways, and it'd be a good chunk of work to actually implement correctly.
Xprint is not deserving of that much love.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20080314/be4f33a1/attachment.pgp>


More information about the xorg mailing list