Re: [gtk-list] gdk... um......... wtf?



On 12 Jan, Owen Taylor shouted:
->  
->  > Um.. okay.. is there anyone who has tried to mesh Xlib code with gdk
->  > before? things arne't looking good.. a simple function call that SHOULD
->  > work.. and without gdk always has worked, now fails wiht low-level X
->  > errors..... has anyone seen this before?
->  > 
->  > gdb:
->  > 
->  > ** ERROR **: BadMatch (invalid parameter attributes)
->  
->  I've mixed the two fairly extensively, without much bad happening.
->  
->  I've also seen that error fairly extensively. It has usually meant
->  that memory was being trashed somewhere, often quite far away
->  from the occurrence. (And often not in my code)
->  
->  But I'd first check if disp has something reasonable in it. 
->  That was often the thing the was being trashed, and I'm made
->  a little suspicious by the cast:
->  
->  >    disp=(Display *)gdk_display;
->  
->  Since gdk_display should already have the type (Display *), if you
->  needed a cast, something might be going wrong. On the other hand,
->  disp can't be total trash, if the earlier XShmQueryExtension worked.

it isnt'.. its not null, and all previous calls work.. and macros (i
tested) of DisplayWidth(disp,screen) and the same for height give
correct figures.. so its a valid Display variable....

that is the ONLY bit of code that is calle.d. from where i start it to
that XShmPixmapFormat call - the rest is gdk code. i've called
gdk_init(&argc, &argv); beofre that... I can't see anythng obvious
wrong.... and i'm baffled that code that was, up till now, working fine
on 1000's of machines suddenly stops if i port it to gdk... hmmmm..
would the malloc call perhaps trash bits of xlib's intenrals? i have
done this before.. but i dont' see how any of this could happen... i
check if the malloc returns NULL.....


->  One approach for such errors has been to put in harmless X calls in
->  various places earlier in my code and see where they start failing.

I did.. and they don't fail.. :(

->  There might be something more obviously wrong, of course, but I
->  don't see it off-hand.

hmm likely.. but neither do I. It's almost a copy & paste affar wiht
that code.. it did work before, and now doesn't... hmm damn! this is a
real thorn in my side!

->  Good luck,
->                                          Owen

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com       /\___ /\ ___/||\___ ____/|/\___  raster@redhat.com
Carsten Haitzler           | _ //__\\ __||_ __\\ ___|| _ /  Red Hat Advanced
218/21 Conner Drive        || // __ \\_ \ | |   \ _/_|| /   Development Labs
Chapel Hill NC 27514 USA   ||\\\/  \//__/ |_|   /___/||\\   919 547 0012 ext 282
+1 (919) 929 9443, 801 4392   For pure Enlightenmenthttp://www.rasterman.com/ 









[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]