<div>Hi all,</div><div><br></div><div>Being recently introduced to xpenguins, I thought it would be hilarious to get the penguins to run around in a window of my choice instead of the desktop (small things for small minds...;)).</div>
<div><br></div><div>To this end I've started fiddling around with the xpenguins source and learning Xlib along the way, and now there's just one thing left to do to achieve heart-warming goodness.</div><div><br></div>
<div>The problem is that the penguins obscure the window on which they are drawn.</div><div>This can be demonstrated by getting xpenguins, using 'xwininfo' on a terminal (say) to get the window ID, and then running</div>
<div><br></div><div>xpenguins -id <window ID>.</div><div><br></div><div>It would be best if the window were maximised and there be no other windows on that desktop (I've put in some changes to get around this in my fiddling but that's besides the point).</div>
<div><br></div><div>You see that the penguins leave little trails of window background colour behind them. Every 100 cycles xpenguins sends an Expose event to the window to remove these. </div><div>By sending an expose event every time a penguin is drawn I can eliminate the trails entirely, _but_ the non-penguin part of the penguin rectangle itself is still drawn in window colour (for the terminal, that grey colour windows are by default).</div>
<div><br></div><div>From examining the xpenguins source (ToonDraw in toon_draw.c), to draw the penguins:</div><div>- the penguin clip mask is applied to the GC (these are penguin-shaped clip masks, I've checked)</div>
<div>- the penguin pixmap is XCopyArea'd over to the window on which the penguins are being drawn, using the GC with the clip mask.</div><div>- said clip mask is removed.</div><div><br></div><div>According to this, the non-penguin pixels should not be drawn on at all, meaning that I shouldn't be getting bits of grey background on the penguins.</div>
<div><br></div><div>Does anyone know why this is still happening?</div><div><br></div><div>Other things I've tried are (assuming we're drawing penguins on a terminal):</div><div>- dropping a clear window (no background pixmap or background pixel) on top of the terminal and drawing on that using the clip mask -- this removes the grey background bits -but- it leaves a trail of penguin behind.</div>
<div>- XCopyArea-ing the relevant bits of the terminal onto my clear window to cover up the penguin trail -- doesn't work (I assume because the terminal is essentially covered up by my clear window/penguin trail?)</div>
<div>- First XCopyArea-ing the relevant bits of terminal onto my penguin pixmap, THEN using the mask to copy just the penguin on top of that, and then XCopyArea-ing that pixmap (ie entire rectangle, not using the mask) onto my clear window.</div>
<div>This gives a weird flickering background that is often blue.</div><div><br></div><div>If anyone can give me some pointers I'd be grateful. I'm at the tearing-hair-out stage.</div><div><br></div><div>[If anyone wants to give this a go I can send a working copy of what I've done so far. ToonDraw() in toon_draw.c is the relevant function].</div>
<div><br></div><div>cheers (sorry for overly-long post)</div><div>Amy</div>