Quartz copy/paste bug?
Hi Simon,
On 8 Mar 2006, at 19:54, Simon Urbanek wrote:
Demitri, I have encountered this bug occasionally, but very rarely. The problem is, I didn't figure a way to reproduce it consistently. I was fiddling around with Quartz locking etc., but without reproducible example, it's almost impossible to fix. If you or anyone else could come up with a way to reproduce this behavior consistently, it would be great. Please let me know if you have a way for this to appear more often - I'd appreciate that.
Unfortunately, I have not been able to reproduce the bug consistently. It "just happens". :) I started to poke through the code, and wanted to get your thoughts on this. In the copy: method in RQuartz.m, I replaced the following code: [deviceView setPDFDrawing:YES]; [deviceView lockFocus]; [deviceView writePDFInsideRect:[deviceView bounds] toPasteboard:pb]; [deviceView unlockFocus]; [deviceView setPDFDrawing:NO]; with: [deviceView setPDFDrawing:YES]; NSRect r = [deviceView bounds]; NSData *data = [deviceView dataWithPDFInsideRect:r]; [pb setData:data forType:NSPDFPboardType]; [deviceView setPDFDrawing:NO]; A very simple (non-exhaustive!) test showed that this code will copy the pdf as expected. Behind the scenes, I don't know if this is any different from what you have, but I'll run with this change for a while to see if it happens again. Cheers, Demitri