Home » Eclipse Projects » Rich Client Platform (RCP) » ViewPart gets screwy on closing
ViewPart gets screwy on closing [message #652380] |
Thu, 03 February 2011 12:12  |
Eclipse User |
|
|
|
Hi,
I have a basic rcp application showing a ViewPart.
The ViewPart contains a GLCanvas displaying a rotating cube.
If I resize the app window and then close it, I get an ugly effect
showing swt controls artifacts (similar to what you would see by setting
the SWT.NO_REDRAW_RESIZE flag, but this is not the case).
Please see this image:
http://goo.gl/84xND
and this gif animation:
http://goo.gl/jMjlZ
to get an idea.
This only happens on closing time IFF the window has been resized.
Otherwise the window closes correctly (i.e. without showing artifacts).
The same GLCanvas app closes correctly under bare SWT.
The canvas and the parent composite have SWT.NO_BACKGROUND set.
Do you know what could be causing this effect and how I could get rid of it?
Regards,
Carlo
|
|
| |
Re: ViewPart gets screwy on closing [message #652568 is a reply to message #652416] |
Fri, 04 February 2011 09:48   |
Eclipse User |
|
|
|
On 2/3/2011 7:58 PM, Paul Webster wrote:
> On 02/03/2011 12:12 PM, Carlo Salinari wrote:
>> If I resize the app window and then close it, I get an ugly effect
>> showing swt controls artifacts (similar to what you would see by setting
>> the SWT.NO_REDRAW_RESIZE flag, but this is not the case).
>
> Are you unhooking/disposing the GLCanvas in the ViewPart dispose()? Or
> in a dispose listener off of an SWT composite you've created?
No, I'm not doing anything in Viewpart.dispose().
The GLCanvas constructor registers a listener to the SWT.Dispose event.
This is the relevant code from org.eclipse.swt.opengl.GLCanvas:
Listener listener = new Listener () {
public void handleEvent (Event event) {
switch (event.type) {
case SWT.Dispose:
WGL.wglDeleteContext (context);
break;
}
}
};
addListener (SWT.Dispose, listener);
How could this be related to my issue?
>> Do you know what could be causing this effect and how I could get rid of it?
>
> I would guess it's the underlying SWT composite not being re-painted (as
> the GLCanvas was on top).
Yes, you are right, and that is intentional. I have to set the
SWT.NO_BACKGROUND flag otherwise the Canvas underlying the GLCanvas
would try to repaint its background when resizing the window, causing an
atrocious flickering effect.
Maybe I should to repaint the
ViewPart's client area in black just before the GLCanvas gets closed, so
to clear the cluttered background. But I don't know how to do that.
Btw, I now realize this is more an swt issue that an rcp one, so excuse
me for the off-topic. So, if I'm not getting an answer here, I'm moving
the thread on e.swt.
Thanks for your reply, Paul.
|
|
| | | | |
Goto Forum:
Current Time: Tue Jul 22 11:51:58 EDT 2025
Powered by FUDForum. Page generated in 0.20113 seconds
|