Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 513800

Summary: No painting on AWT Canvas embedded into an SWT Expand bar on GTK3
Product: [Eclipse Project] Platform Reporter: ChristianR <bror>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: ericwill
Version: 4.6Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
Sample source code and expected vs. error screenshot none

Description ChristianR CLA 2017-03-17 05:50:58 EDT
Created attachment 267310 [details]
Sample source code and expected vs. error screenshot

I have been using an AWT canvas embedded into an SWT expand bar in an application.
When migrating from RCP 4.3 to 4.6.2 the canvas stays black.
I have created a small piece of code to reproduce the problem. Running this code with RCP 4.3 SWT libraries succeeds (using GTK2 or GTK3). On RCP 4.6.2 SWT libraries the canvas stays black on GTK3. When manually forcing GTK2 I get correct output.

The sample code I have attached should normally display a shell with an expand bar in the left half. There is one expanded item which should contain a line on widget background color. For verification of the small class doing the drawing operation I have added the same AWT canvas to the right half of the SWT shell where it shows properly outside of an expand bar.
I have also attached an expected and an error screen shot.

On RCP 4.6.2 SWT libraries I have an error on the console:
"(SWT:25778): Gdk-WARNING **: XSetErrorHandler() called with a GDK error trap pushed. Don't do that."

There is no error on the console on RCP 4.3 SWT libraries.



I have briefly observed this when trying to migrate to RCP 4.5. I discovered this amongst others and stopped migration without too much analysis.

Severity "blocker" means of course blocking for me. If this will only happen within Expand bars (I don't know) then it may be a rare case and I understand if someone lowers the severity.
Comment 1 ChristianR CLA 2017-03-20 07:59:51 EDT
It seems I can solve the problem by moving the creation of the AWT canvas to a place in the code after the ExpandItem referencing to it is fully created and configured. In the source code this means I move the line

new AWTCanvasWidget(container);

down after the line

item.setExpanded(true);

Now it works for me so this is no blocker to me anymore. I don't see why this change is needed. On Windows it runs well without this change. Also on GTK2 it runs. So there might be a general problem for GTK3 behind it and I keep the bug open.
Comment 2 Eclipse Genie CLA 2021-01-29 18:29:52 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.