Skip to content
Prev 2489 / 15075 Next

Quartz copy/paste bug?

Hi Simon,
On 8 Mar 2006, at 19:54, Simon Urbanek wrote:

            
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