Bug 323670 - [Palette] Screen areas disappear if PaletteViewer is used on Form/FormPage on Mac
Summary: [Palette] Screen areas disappear if PaletteViewer is used on Form/FormPage on...
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-25 21:09 EDT by Holger Knublauch CLA
Modified: 2011-07-28 12:05 EDT (History)
5 users (show)

See Also:


Attachments
A screenshot showing the desired outcome (OK) (17.31 KB, image/png)
2010-08-25 21:10 EDT, Holger Knublauch CLA
no flags Details
This shows the error - large areas of the screen are empty (13.13 KB, image/png)
2010-08-25 21:11 EDT, Holger Knublauch CLA
no flags Details
The plugin. The only difference from the tutorial is GraphEditor (36.46 KB, application/zip)
2010-08-25 21:15 EDT, Holger Knublauch CLA
no flags Details
Bug Editor, use it instead of GraphEditor. It is simpler (3.95 KB, application/zip)
2011-07-28 12:02 EDT, Yahor Radtsevich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Knublauch CLA 2010-08-25 21:09:44 EDT
Build Identifier: I20100608-0911

We have a professional Eclipse-based tool that uses a FormEditor with multiple tabs (FormPages). One of those contains a GEF graph editor with a Flyout Palette. In Eclipse 3.5 (on Mac only) there was a problem that the palette was sometimes becoming invisible, and the user had to resize the window or move the sash to actually see it.

But with Helios this situation has become significantly worse, and now the areas of the FormPage (including the button tool bar and the graph itself) are invisible most of the time. The screen flickers and only if scrollbars are visible, the graph is visible too. Otherwise it's just a grey area.

I have managed to reproduce this problem in a simpler case, and I attach a demo plugin. The plugin is basically the same as the one used by Koen Ars EclipseCon 2008 tutorial: http://www.eclipsecon.org/2008/?page=sub/&id=102. The only difference is that the GraphEditor is a subclass of FormEditor, and that I am inserting the GEF component into a FormPage. The key bit of code is this:

	protected void addPages() {
		
		FormPage page = new FormPage(this, "XY", "TAB") {

			@Override
			protected void createFormContent(IManagedForm managedForm) {
				super.createFormContent(managedForm);
				
				Composite body = managedForm.getForm().getBody();
				body.setLayout(new GridLayout());
				
				SashForm form = new SashForm(body, SWT.HORIZONTAL);
				form.setLayoutData(new GridData(GridData.FILL_BOTH));
				createPaletteViewer(form);
				createGraphViewer(form);
				form.setWeights(new int[] { 15, 85 });
				
				managedForm.getForm().getToolBarManager().add(new Action("Test") { } );
				managedForm.getForm().getToolBarManager().update(false);
			}
		};
		
		try {
			addPage(page);
		}
		catch(PartInitException ex) {
			ex.printStackTrace();
		}
	}

See steps to reproduce. I believe this happens more often if the tool bar contains anything, and also only in conjunction with the palette. Maybe there is an exception in the middle of the drawing subroutine.

While this particular example seems to be uncritical, I suspect that this is the same bug that we are seeing in our commercial tool, and there it happens much more reliably and the situation is a blocker for us.

I would like to understand whether this is indeed a bug or whether placing a paletteViewer inside a Form is simply not supported and I need to work around it. Many thanks.

Reproducible: Always

Steps to Reproduce:
1.Install the plugin (that I am trying to attach to this bug report)
2.Create an empty file ending with .par
3.Open the .par file in the Graphical editor (this plugin)
4. Move the divider between the Navigator and the Graph Editor
You should see the whole page flickering, and on many pixels, the whole content disappears
Comment 1 Holger Knublauch CLA 2010-08-25 21:10:43 EDT
Created attachment 177484 [details]
A screenshot showing the desired outcome (OK)
Comment 2 Holger Knublauch CLA 2010-08-25 21:11:21 EDT
Created attachment 177485 [details]
This shows the error - large areas of the screen are empty
Comment 3 Holger Knublauch CLA 2010-08-25 21:15:00 EDT
Created attachment 177486 [details]
The plugin. The only difference from the tutorial is GraphEditor
Comment 4 Stefan Wagner CLA 2010-10-06 07:57:14 EDT
Same problem here (Eclipse 3.6.1, Mac OS 10.6.4).
Are there any new insights or workarounds?
Comment 5 Holger Knublauch CLA 2010-10-06 17:03:44 EDT
(In reply to comment #4)
> Same problem here (Eclipse 3.6.1, Mac OS 10.6.4).
> Are there any new insights or workarounds?

I honestly don't get the impression that GEF is actively maintained right now - otherwise there would probably have been some kind of acknowledgement at least. Since this bug was a show stopper for me, I had to manually re-implement my own Palette based on a TreeViewer within a SashForm and this works fine.
Comment 6 Alex Boyko CLA 2010-10-06 19:07:21 EDT
Sorry for unintentionally ignoring this defect... None of us work on a Mac machine, so we can't reproduce the issue and advice much on it. I've tried it on XP and works fine on XP.

BTW, do you specifically want it to be a SashForm? Think you could have used a GEF Splitter for this purpose. See GraphicalEditorWithPalette#createPartControl(...) mathod.

Given that it's a MAC specific issue, my guess would be that the actual problem is with SWT, namely repainting. If you just try puting two plain SWT canvases, will you get the same issue?
Comment 7 Holger Knublauch CLA 2010-10-06 19:17:40 EDT
(In reply to comment #6)
> Sorry for unintentionally ignoring this defect... None of us work on a Mac
> machine, so we can't reproduce the issue and advice much on it. I've tried it
> on XP and works fine on XP.

Thanks for responding.

> BTW, do you specifically want it to be a SashForm? Think you could have used a
> GEF Splitter for this purpose. See
> GraphicalEditorWithPalette#createPartControl(...) mathod.
> 
> Given that it's a MAC specific issue, my guess would be that the actual problem
> is with SWT, namely repainting. If you just try puting two plain SWT canvases,
> will you get the same issue?

It looks like a very low level problem, and this makes it very difficult to debug or understand this. My replacement code uses SWT components (Tree and SashForm) and those work fine.

I must say I am very surprised to hear that nobody in the GEF team uses a Mac - how on earth is QA happening then? I am afraid that providing you with the original test case is all I can do at this stage - I have already spent very much time on this issue.
Comment 8 Randy Hudson CLA 2010-10-06 20:05:33 EDT
This is an SWT problem.  I'm seeing this in other places that aren't even using GEF.  I've only seen this on the Cocoa version of SWT, so one workaround is to use the Carbon version of SWT, which has been around longer.
Comment 9 Alexander Nyßen CLA 2011-02-23 16:15:51 EST
I can confirm the problem is not reproducible on Mac Carbon, while it still occurs on Mac Cocoa with the current 3.7 Eclipse build (I used N20110213 to reproduce). Changing platform to Mac Cocoa to indicate this.
Comment 10 Alexander Nyßen CLA 2011-02-23 16:24:31 EST
(In reply to comment #9)
> I can confirm the problem is not reproducible on Mac Carbon, while it still
> occurs on Mac Cocoa with the current 3.7 Eclipse build (I used N20110213 to
> reproduce). Changing platform to Mac Cocoa to indicate this.

Interestingly it does not happen when I start my runtime platform via debugger.
Comment 11 Alexander Nyßen CLA 2011-02-23 16:28:32 EST
(In reply to comment #10)
> (In reply to comment #9)
> > I can confirm the problem is not reproducible on Mac Carbon, while it still
> > occurs on Mac Cocoa with the current 3.7 Eclipse build (I used N20110213 to
> > reproduce). Changing platform to Mac Cocoa to indicate this.
> 
> Interestingly it does not happen when I start my runtime platform via debugger.

Forget that last comment. It does not have something to do with the debugger. It is actually not reproducible when the editor is already open when starting up the runtime platform. To reproduce it, I have to close and re-open the editor again.
Comment 12 Yahor Radtsevich CLA 2011-07-28 11:57:37 EDT
I agree that this should be assigned to the SWT component. It definitely not easy to reproduce on pure SWT, but I get the same problem in a plugin which do not use GEF [1].

I significantly simplified the previously attached GraphEditor so that it takes only several dozen lines of code. It uses only SWT widgets and the LightweightSystem class from draw2d. Will attach it as 'Bug Editor'.

Steps to Reproduce in Bug Editor:
1.Install the attached plugin org.eclipse.bug-test
2.Create an empty file ending with .bu
3.Open the .bu file in the editor (this plugin)
4. Try to resize this editor (but not Eclipse window) by double-clicking on the header or from its right side.
You should see the whole page flickering, and on many pixels, the whole content
disappears

[1] https://issues.jboss.org/browse/JBIDE-8711
Comment 13 Yahor Radtsevich CLA 2011-07-28 12:02:49 EDT
Created attachment 200540 [details]
Bug Editor, use it instead of GraphEditor. It is simpler