Question for Mac Jogl users

Has anyone had issues with jogl screens not redrawing their openGL content properly if you close them then make them visible again?

I have a contract which i’ve pretty much completed but for this one bug - the client has the app running on a PC and two macs. The PC works fine (my computer is a PC and it works fine for me too) but on both of the client’s Macs, the display does not come back properly.

To be precise, what I am doing is this:

  • I attach my GLCanvas to a JDialog for display - works fine.
  • I leave the window closing action to the default (make invisible) so that the dialog can be closed then brought back with jDialog.setVisible(true) - this is via a menu option.
  • The dialog goes visible / invisible quite happily.
    But… the openGL content is no longer visible when the dialog comes back from being invisible.

Anyone got any ideas?

Failing that, could a kind mac user attach a GLCanvas to a JDialog and try this scenario out for me? TIA! ;o)

Thanks for any help,

Peter.

I’m pretty busy ATM, but if post an example, I’ll be happy to try it out on my mac :slight_smile:

You are right in that it doesn’t work. The surfaces do not get restored properly for reasons that I never really spent a lot of time investigating because I found it easier to in my window listener destry and recreate the context.

Thanks for the feedback Gregory - I’ll give your approach a go.

Do you know if this issue has been raised as a Jogl / Mac bug?

As of the most recent JOGL beta we’ve made attempts to properly destroy and recreate the OpenGL context upon removeNotify() / addNotify() on the GLCanvas. It seems to work at least for trivial examples on all platforms so if you see any issues please file a bug and attach a test case.