First GLWindow in first NewtCanvasAWT doesn't get .repaint(), when there are other windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

First GLWindow in first NewtCanvasAWT doesn't get .repaint(), when there are other windows

michalrus
Hello. :)

I've got a little problem with automatic repainting of all-but-last GLWindows whenever they get covered by something. This post is a copy of question asked on SO, that's where the formatting comes from.

---

I have two [JOGL](https://jogamp.org/jogl/) native `GLWindow`s wrapped in `NewtCanvasAWT`.

These canvases are added to `JInternalFrame`s each. `JInternalFrame`s are added to `JDesktopPane` which is added to a `JFrame`.

I don't have an `Animator` running because `.display()` is called manually, when scene changes.

---

This setup works as expected apart from one thing:

* when the second `JInternalFrame` (order of creation) moves over the first, the first is not repainted, what is quite unexpected,

* when the first moves over the second, the second *is* repainted, as expected.

* If I add more frames, only the last one behaves as expected.

The `JInternalFrames` are identical (the same class).

The first `GLWindow` doesn't receive `WindowUpdateEvent` in `WindowListener.windowRepaint()`. The second one does.

Here's the stack trace of my `GLEventListener.display(GLAutoDrawable drawable)` from the *working* `JInternalFrame`:


    java.lang.IllegalArgumentException: test
    at edu.agh.tunev.ui.opengl.Scene.display(Scene.java:42)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:373)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:358)
    at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:280)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:655)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:594)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowRepaintOp(GLAutoDrawableBase.java:99)
    at com.jogamp.newt.opengl.GLWindow.access$000(GLWindow.java:94)
    at com.jogamp.newt.opengl.GLWindow$1.windowRepaint(GLWindow.java:107)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2392)
    at jogamp.newt.WindowImpl.consumeEvent(WindowImpl.java:1943)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:388)
    at jogamp.newt.DisplayImpl.dispatchMessages(DisplayImpl.java:436)
    at jogamp.newt.DisplayImpl$DispatchMessagesRunnable.run(DisplayImpl.java:371)
    at jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:293)

This should also happen with the *first* frame. Why doesn't it?

---

All this does not happen when using `GLJPanel` or `GLCanvas`. However, I do not want to use AWT thread for rendering and these `GLAutoDrawable`s use it. `NEWT` native windowing toolkit uses another thread.
Reply | Threaded
Open this post in threaded view
|

Re: First GLWindow in first NewtCanvasAWT doesn't get .repaint(), when there are other windows

Sven Gothel
Administrator
On 04/29/2013 06:32 PM, michalrus [via jogamp] wrote:
> Hello. :)
>
> I've got a little problem with automatic repainting of all-but-last GLWindows
> whenever they get covered by something. This post is a copy of question asked
> on SO
> <http://stackoverflow.com/questions/16281603/first-glwindow-in-first-newtcanvasawt-doesnt-get-repaint-when-there-are-oth>,
> that's where the formatting comes from.

We would need more information:
  - See Wiki.FAQ.Bugreport (Platform .. etc .. test.log test_dbg.log)
  - Small test case to reproduce

Especially since all the AWT and Swing related unit test are everything
but easy to reproduce w/o a strict description. A unit test/demo
would be most clear w/ information of the test platform.

~Sven


>
> ---
>
> I have two [JOGL](https://jogamp.org/jogl/) native `GLWindow`s wrapped in
> `NewtCanvasAWT`.
>
> These canvases are added to `JInternalFrame`s each. `JInternalFrame`s are
> added to `JDesktopPane` which is added to a `JFrame`.
>
> I don't have an `Animator` running because `.display()` is called manually,
> when scene changes.
>
> ---
>
> This setup works as expected apart from one thing:
>
> * when the second `JInternalFrame` (order of creation) moves over the first,
> the first is not repainted, what is quite unexpected,
>
> * when the first moves over the second, the second *is* repainted, as expected.
>
> * If I add more frames, only the last one behaves as expected.
>
> The `JInternalFrames` are identical (the same class).
>
> The first `GLWindow` doesn't receive `WindowUpdateEvent` in
> `WindowListener.windowRepaint()`. The second one does.
>
> Here's the stack trace of my `GLEventListener.display(GLAutoDrawable
> drawable)` from the *working* `JInternalFrame`:
>
>
>     java.lang.IllegalArgumentException: test
>     at edu.agh.tunev.ui.opengl.Scene.display(Scene.java:42)
>     at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:373)
>     at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:358)
>     at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:280)
>     at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:655)
>     at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:594)
>     at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:543)
>     at
> jogamp.opengl.GLAutoDrawableBase.defaultWindowRepaintOp(GLAutoDrawableBase.java:99)
>
>     at com.jogamp.newt.opengl.GLWindow.access$000(GLWindow.java:94)
>     at com.jogamp.newt.opengl.GLWindow$1.windowRepaint(GLWindow.java:107)
>     at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:2392)
>     at jogamp.newt.WindowImpl.consumeEvent(WindowImpl.java:1943)
>     at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:388)
>     at jogamp.newt.DisplayImpl.dispatchMessages(DisplayImpl.java:436)
>     at jogamp.newt.DisplayImpl$DispatchMessagesRunnable.run(DisplayImpl.java:371)
>     at
> jogamp.newt.DefaultEDTUtil$EventDispatchThread.run(DefaultEDTUtil.java:293)
>
> This should also happen with the *first* frame. Why doesn't it?
>
> ---
>
> All this does not happen when using `GLJPanel` or `GLCanvas`. However, I do
> not want to use AWT thread for rendering and these `GLAutoDrawable`s use it.
> `NEWT` native windowing toolkit uses another thread.
>
> ------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/First-GLWindow-in-first-NewtCanvasAWT-doesn-t-get-repaint-when-there-are-other-windows-tp4029073.html
>
> To start a new topic under jogl, email [hidden email]
> To unsubscribe from jogl, click here
> <
> NAML
> <
http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

--
health & wealth
mailto:[hidden email] ; http://jausoft.com
land : +49 (471) 4707742 ; fax : +49 (471) 4707741
Timezone CET: PST+9, EST+6, UTC+1


signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: First GLWindow in first NewtCanvasAWT doesn't get .repaint(), when there are other windows

michalrus