Bug 1161 - Canvas resize stops the rendering in Mac OS X
Summary: Canvas resize stops the rendering in Mac OS X
Alias: None
Product: Jogl
Classification: JogAmp
Component: awt (show other bugs)
Version: 2.3.2
Hardware: pc_all macosx
: --- major
Assignee: Sven Gothel
Depends on:
Reported: 2015-06-11 15:29 CEST by president
Modified: 2015-09-27 01:11 CEST (History)
0 users

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description president 2015-06-11 15:29:26 CEST
There is a "resize" problem with JOGL in Mac OS X.

When I run the following jogl demo it works fine at first. But when I try to resize it the canvas disappears. I just see a blank jpanel in its place.


The Mac OS X version is 10.9.5 or higher 
Java 1.8.0_45

It also doesn't work on Yosemite 10.10.3
It is reproducible both with and without Java Webstart. Our standalone application has same problem.

This bug was first reported in jogl forum here:
Comment 1 Sven Gothel 2015-07-25 19:17:06 CEST
Test machine 
  - OSX 10.10.4
  - Java 1.8.0_51 x64
  - Java 1.6.0_65-b14-466.1 x32 and x64

JOGL Unit Tests:
  - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT: OK
  - com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT: OK

JOGL Demos:
  - Manual demos.gears.Gears: OK

  - JNLP Launch reproduces the issue: ERROR

    - Error is reproduced if resizing very fast about a bigger amount,
      e.g. 50% - for the first time!

    - Error is not reproduced if first resize happen slowly about
      a tiny amount. Later fast resizes work then.

Hence we do have an issue at least on latest OSX w/ latest java8
when running as WebStart - and w/ 'fast resize'.
Comment 2 Sven Gothel 2015-07-28 00:36:54 CEST
Root cause:

JAWTWindow's JAWTComponentListener 'isShowing'
state is initialized while attaching it on-thread
and updated via hierarchy-changed event.

JAWTComponentListener attachment to the component 
is issued at JAWTWindow's creation but on the AWT-EDT,
hence it may happen at a later time.

In this bug scenario, it happens very late,
so that the hierarchy-changed event is missed 
and 'isShowing' is never set to 'true'.

Solution is to update 'isShowing' state
on the actual AWT-EDT when attaching to the component.
Also make 'isShowing' volatile.
Comment 3 Sven Gothel 2015-07-28 00:38:34 CEST
commit 4eeddd0d446f8491dde2e5b0e3e11e0d5b0be9b7

Fixed as described in comment 2