Home » Eclipse Projects » Rich Client Platform (RCP) » ViewPart gets screwy on closing
| |
Re: ViewPart gets screwy on closing [message #652568 is a reply to message #652416] |
Fri, 04 February 2011 14:48 |
Carlo Salinari Messages: 66 Registered: October 2010 |
Member |
|
|
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: Fri Apr 26 05:11:21 GMT 2024
Powered by FUDForum. Page generated in 0.03484 seconds
|