CTabFolder/CTabItems flashing on focus change [message #1839690] |
Thu, 25 March 2021 18:57 |
Michael Maenz Messages: 3 Registered: December 2016 |
Junior Member |
|
|
Hi,
we are using CTabFolder with several CTabItems, each containing a SWT Canvas with native handle (required!) and an opengl context to draw 3d things.
Everytime the CTabFolder gets or loses focus the whole thing with item children is redrawn which is expensive and results in white flashing. The redraw for the (active/selected) CTabItems is not needed at all.
I already implemented my own TabFolderRenderer but there is no way to tell what is going to be redrawn and to prevent it. I first thought CTabFolder supports SWT.DOUBLE_BUFFERED but it's not derived from Composite (I have overriden StackRenderer.getStyleOverride() to return SWT.DOUBLE_BUFFERED).
CTabFolder can't be extended or overridden in any form. Reimplementing 99% of CTabFolder only to prevent redraw is not a proper solution either.
My question is if there is a way to prevent redrawing of items or any chance to draw to temporary GC and swap after everything is completed?
Edit:
It would be helpful if CTabFolder.onPaint creates a buffer instead of drawing to active gc
Image img = new Image(display, width, height);
GC buffer = new GC(img);
draws everything on that buffer gc and finally
event.gc.drawImage(img, 0, 0);
gc.dispose();
img.dispose();
copies the result to the actual gc.
I'm not sure if this works seamless. I'll give it a try and report back.
Thank you very much!
[Updated on: Thu, 25 March 2021 22:16] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03385 seconds