Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

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

Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
Hello,

when exiting fullscreen in TestGearsES2NewtCanvasAWT.java it seems the reshape doesn't happen as one would expect. While the viewport is cut down to the lower resolution, it seems the renderer is still in the full screen resolution. As a result, only the red wheel is partially visible, expanded as it was on fullscreen.

Is this normal? I would guess it's based on the two threads (entering/exiting) fullscreen and the GL thread are not in synch. Any idea how one would go about this issue?
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

gouessej
Administrator
Hi

When exiting the full screen mode, the latest resolution in windowed mode is used, not the resolution in full screen mode. This is the expected behaviour. If you want to change that, modify the resolution before entering the full screen mode or just after exiting it.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
Hey,

thanks for your answer. It seems from your description that my behavior is different. Have a look at this screenshot[0]. Here it looks like after exiting fullscreen, the gears are still in 1920x1200 resolution. I'm on Debian btw.

[0] http://i.imgur.com/sWbcHLL.png
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

gouessej
Administrator
Actually, the size depends on the mode, not the resolution, my previous comment was a bit wrong. Anyway, you can modify this behaviour.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
This post was updated on .
Isn't the expected behavior that it returns to windowed mode resolution? I'm not quite sure where to implement the change. I tried setting the viewport in reshape() which did not change anything. Do I have to implement displayChanged()?

Edit: I tried saving the resolution before going into fullscreen inside the keylistener that listens for pressing f. After switching out, I check if we are still in fullscreen, if not, I do glWindow.setSize() with the previously saved values. I get the following console output:

01. [set fullscreen  pre]: 0/0 1920x1200, f true, a false, [ l 0, r 0 - t 0, b 0 - 0x0]
02. window resized: 0/0 640x480
03. window resized: 0/0 640x480
04. Back out of fullscreen. Set: 640, 480
05. Thread[main-Animator,5,main] GearsES2.reshape 0/0 640x480, swapInterval 1, drawable 0x3400002, msaa false, tileRendererInUse null
06. >> angle 176.0, [l -1.3333334, r 1.3333334, b -1.0, t 1.0] 2.6666667x2.0 -> [l -1.3333334, r 1.3333334, b -1.0, t 1.0] 2.6666667x2.0
07. [set fullscreen post]: 0/0 640x480, f false, a false, [ l 0, r 0 - t 0, b 0 - 0x0]
08. window resized: 0/0 1920x1200
09.Thread[main-Animator,5,main] GearsES2.reshape 0/0 1920x1200, swapInterval 1, drawable 0x3400002, msaa false, tileRendererInUse null
10. >> angle 184.0, [l -1.6, r 1.6, b -1.0, t 1.0] 3.2x2.0 -> [l -1.6, r 1.6, b -1.0, t 1.0] 3.2x2.0
11. QUIT Window Thread[main-Display-.x11_:0-1-EDT-2,6,main]

As you can see, in the first line, we are in fullscreen, we exit and the window is resized to 640x480 (line 02&03).
I added the 'Back out of fullscreen' message (04), after which I call glWindow.setSize().
We see that the thread issues a reshape to 640x480 (05).
However in line 08 and 09 it is once again reshaped to 1920x1200.

I don't understand where and why 08 and 09 happen.
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
I filed a bug report for this: https://jogamp.org/bugzilla/show_bug.cgi?id=836
Please see the JUnit test I included.
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
I've ran the JUnit test on several Debian machines and it fails on all of them. Is this not an issue for anyone else?
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

jmaasing
I'll try the unit test this weekend on an Mac OSX 10.8 and see if it behaves correctly there. Currently my Debian machine is headless and stashed in a closet :-)
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

gouessej
Administrator
In reply to this post by andrei
andrei wrote
Is this not an issue for anyone else?
I don't use AWT.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

Sven Gothel
Administrator
In reply to this post by andrei
On 09/13/2013 10:08 AM, andrei [via jogamp] wrote:
> I filed a bug report for this: https://jogamp.org/bugzilla/show_bug.cgi?id=836
> Please see the JUnit test I included.
>

Thank you, I will have a look at .. but it may take a while.

~Sven



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

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

jmaasing
I rewrote the unit test somewhat to be runnable as a stand alone JUNit test (hope I didn't break anything but I only changed the glWindow.addGLEventListener(this))

Anyhow, I ran it on my OSX 10.8 machine (using 2.0.2 JAR files + JDK 1.7_u40). The test starts fine in windowed mode, then switching to fullscreen. It looks like the resize works when switching back to windowed mode from fullscreen. The window appears but then the test crashes in native code after less than a second.
I added the crash report as a comment on bug 836. Let me know if I should file a separate bug report
Reply | Threaded
Open this post in threaded view
|

Re: Exiting Fullscreen in TestGearsES2NewtCanvasAWT.java

andrei
In reply to this post by Sven Gothel