Bug 572319

Summary: [Printer] Printer class draws blank pages
Product: [Eclipse Project] Platform Reporter: Tobiel Gaspi <tobiel.gaspi>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.19   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Tobiel Gaspi CLA 2021-03-25 22:01:48 EDT
org.eclipse.swt.printing.Printer writes only blank pages after the Windows security updates on https://docs.microsoft.com/en-us/windows/release-health/windows-message-center#1574. (Dated March 18, 2021
07:00 PM PT)
 
--- Printer.java
...
Printer p = new Printer(printerData)
... // start job
GC gc = new GC(p);
// draw on GC
gc.dispose();
... // end job
---

Eventually, after p.endJob(), the printer will write only blank pages.
This only happened after the mentioned Windows update.

Is there a way to resolve this issue without applying the out-of-band security patches released by Windows?
Comment 1 Tobiel Gaspi CLA 2021-03-25 22:10:30 EDT
Additional Info:

The issue seems to happen when the following methods are called while drawing on the GC object.

org.eclipse.swt.graphics.Image#getImageData()
* If at any point this method is called on an Image that is drawn to the GC, the printout will be blank.
* This seems to contradict the documentation that modifying the ImageData will not affect the Image.
* Even if the method is simply called, and the returned ImageData object is not modified, the output of the printer will still be blank.