Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 223800 - Control.print(GC) does not work when an ancestor is not visible
Summary: Control.print(GC) does not work when an ancestor is not visible
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC All
: P3 major with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 05:57 EDT by Christopher Deckers CLA
Modified: 2019-10-08 10:50 EDT (History)
2 users (show)

See Also:


Attachments
Shows the bug, with 2 commented lines to test other scenarios (2.35 KB, text/java)
2008-03-25 05:57 EDT, Christopher Deckers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Deckers CLA 2008-03-25 05:57:30 EDT
Created attachment 93361 [details]
Shows the bug, with 2 commented lines to test other scenarios

Build ID: 3.4M5

Steps To Reproduce:
1. Create a control.
2. Hide one of that control's ancestors (like the shell) and print(gc) the control.
3. The resulting image does not contain anything (true is returned though)

This was tested with the Browser, though it is likely the bug affects all controls.

More information:
This may be linked to bug 223590

This is quite critical for us. We have some components we need to print, and we have to make the hierarchy visible and restore the hierarchy visibility state. This flickers and does not provide a good user experience.
Comment 1 Christopher Deckers CLA 2008-04-01 04:50:33 EDT
Tested with 3.4M6.

This bug affects windows and Linux.

There is an exception though: on Windows a Button can be printed in its entirety even though some of its ancestors are hidden. Browser fails.
Comment 2 Steve Northover CLA 2008-04-11 17:04:13 EDT
It is unlikely I will get to this for 3.4.
Comment 3 Christopher Deckers CLA 2009-03-21 17:21:39 EDT
I made further tests with SWT-N20090320-2000 to see how it behaves with the recent GC improvements.

1. On Windows

If fixPrintWindow is artificially set to true in Control.printWidget(int, int, GC), then everything works fine.
I think fixPrintWindow should be set to true if one of the ancestors is not visible, which is probably an easy fix.

2. On Linux

The three cases from the code sample do not work (even the one that works on Windows).
Comment 4 Silenio Quarti CLA 2009-03-24 09:54:48 EDT
Fixed the problem on Windows when the parent is not visible.

I still need to investigate Linux.
Comment 5 Eclipse Genie CLA 2019-03-23 18:03:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Lars Vogel CLA 2019-10-08 10:50:52 EDT
This bug was marked as stalebug a while ago. Marking as wontfix.

If this report is still relevant for the current release, please
reopen and remove the stalebug whiteboard tag.