[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

854.0. "detecting PIXMAP failures..." by 32148::KLEINSORGE (Toys 'R' Us) Tue May 30 1989 14:01

    
    I'm trying to figure out the "right" way to detect that a PIXMAP
    creation has failed.  I've come up with a hack that seems to work,
    but I figure there must be some nice neat way to do it that I've
    overlooked.
    
    

T.RTitleUserPersonal
Name
DateLines
854.119584::BRANDENBERGSi vis pacem para bellumTue May 30 1989 14:2514
    
    The neatest way I know of detecting an error on a particular
    request is to:
    
    	XSync()
    	Replace error handler with your own special one
    	XAsyncRequestThatMightFail()
    	XSync()
    	Restore original error handler
    
    If there's a neater way, I'd like to hear about it...
    
    					m

854.232148::KLEINSORGEToys 'R' UsTue May 30 1989 16:266
    
    Yup.  That's my hack, but I was hoping for something a little neater...
    
    Thanks, _Fred
    

854.3why are pixmap errors more difficult than other typesHANNAH::OSMANsee HANNAH::IGLOO$:[OSMAN]ERIC.VT240Thu Jun 01 1989 16:0713
Can someone please explain more about this ?  Some things I'm puzzled about:

o	I assume you're talking about XCreatePixmap ?  Can't we just look at
	the result, and 0 means it failed ?

o	Why would we need special methods of detecting this error than
	other sorts of errors ?

Thanks.

/Eric

854.4VWSENG::KLEINSORGEToys 'R' UsThu Jun 01 1989 17:2718
    This is probably why DECterm goes bonkers when it can't create backing
    store :-(
    
    - No, you can't just "check for zero", 99% of all Xlib calls are NOT
    synchronous.  Xlib sends the request off (the next time the buffer is
    flushed) and returns a identifier for the pixmap -- at some future point
    in time the server *might* send back an error asynchronous to program
    execution.  So you need to use one of the synchronize mechanisms and set
    up (at least temporarily) a error handler for non-fatal X errors.  The
    first synch makes sure there are no errors still not seen, you try to
    create the pixmap - if you get past the next SYNCH without the error
    routine being invoked -- you've succeeded in the create -- otherwise
    you've failed and you can take the appropriate actions... I was just
    hoping that there was some way to identify the operation in the error
    routine without the need for a SYNCH... like if there was a way to get
    the current serial number before making the pixmap create request...
    

854.5Pity...HANNAH::MESSENGERBob MessengerSat Jun 03 1989 17:1711
Re: .4

>    This is probably why DECterm goes bonkers when it can't create backing
>    store :-(

I naively assumed that since I was getting back a pixmap ID the server "must"
have synchronized the request.  Unfortunately I probably won't have a chance
to fix this any time soon.

				-- Bob

854.6IdeasDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Sun Jun 04 1989 17:0818
    Fred,
    
    I have not gone back to read all this over again to re-get the context
    and see if what I am about to say is relavent, but:
    
    1.  There is a macro (at least in V2 if not V1) to get the current
    serial number, and
    
    2.  If you did something like a GetImage (of a 1x1 area) on the pixmap
    after you create it, you should be able to figure out pretty quickly.
    If the GetImage fails, for example, the pixmap is not there.  And the
    GetImage is synchronous.  Don't have my Xlib book at home, so I don't
    know if you would still have to set up an error handler, of if GetImage
    has a status return.
    
    Burns
    

854.7VWSENG::KLEINSORGEToys 'R' UsMon Jun 05 1989 09:5210
    
    Great!  If you find out the name of the Macro, I'll check out alternate
    means of accomplishing what I want without need to synchronize...  if
    I remember right, the error block has the serial number of the request
    just prior to the failing one... so I can set up a error handler that
    can check for specific known requests where I might expect a failure
    (like backing store pixmap allocation).  If I pick up the current
    serial number just before the call...
    

854.8XNextRequestDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Jun 05 1989 16:474
The handy-dandy book reader says it is "XNextRequest".  It is in version 1.

Burns

854.9VWSENG::KLEINSORGEToys 'R' UsMon Jun 05 1989 17:045
    
    Silly me.  I never thought to look there.  Thanks!
    
    _Fred