LWJGL Forum

Archive => Resolved Bugs/RFE => Topic started by: trulsnes on March 06, 2013, 20:48:31

Title: [FIXED] Mode switching on close, even in window mode?
Post by: trulsnes on March 06, 2013, 20:48:31
Edit: After updating from xorg 1.13.1 to the just released 1.13.3 it went away. Probably xrandr related then. Still strange it didn't affect kde though..

At least it looks like what typically happens when switching mode. What happens is the screen goes black for about 4 seconds every time I close the windowed application. This is all I do:

1. Run example application in windowed mode. Everything looks fine.
2. Close it. Screen goes black, then eventually returns and everything looks normal.

Note that this doesn't happen in KDE so I'm guessing it at least isn't a driver issue. It's not a really big problem for runtime but for development, waiting 4 seconds for every time you run the application, it is:/

XFCE/Gnome/Ccinnamon:
[localhost gl]$ ./launch.sh
[LWJGL] Xrandr extension version 1.4
[LWJGL] Using Xrandr for display mode switching
[LWJGL] Did not match: primary
[LWJGL] XF86VidMode extension version 2.2
[LWJGL] Initial mode: 1920 x 1200 x 24 @50Hz
1920 x 1200 x 24 @50Hz
[LWJGL] Pixel format info: r = 8, g = 8, b = 8, a = 0, depth = 24, stencil = 0, sample buffers = 0, samples = 0
[LWJGL] MemoryUtil Accessor: AccessorUnsafe
Could not locate symbol glProgramUniform1dEXT
Could not locate symbol glProgramUniform2dEXT
Could not locate symbol glProgramUniform3dEXT
Could not locate symbol glProgramUniform4dEXT
Could not locate symbol glProgramUniform1dvEXT
Could not locate symbol glProgramUniform2dvEXT
Could not locate symbol glProgramUniform3dvEXT
Could not locate symbol glProgramUniform4dvEXT
Could not locate symbol glProgramUniformMatrix2dvEXT
Could not locate symbol glProgramUniformMatrix3dvEXT
Could not locate symbol glProgramUniformMatrix4dvEXT
Could not locate symbol glProgramUniformMatrix2x3dvEXT
Could not locate symbol glProgramUniformMatrix2x4dvEXT
Could not locate symbol glProgramUniformMatrix3x2dvEXT
Could not locate symbol glProgramUniformMatrix3x4dvEXT
Could not locate symbol glProgramUniformMatrix4x2dvEXT
Could not locate symbol glProgramUniformMatrix4x3dvEXT
[LWJGL] GL_ARB_gpu_shader_fp64 was reported as available but an entry point is missing
Could not locate symbol glVertexWeighthNV
[LWJGL] Mode 0: 1920x1200 @50
[LWJGL] XF86VidMode extension version 2.2
[localhost gl]$


KDE:
[localhost gl]$ ./launch.sh
[LWJGL] Xrandr extension version 1.4
[LWJGL] Using Xrandr for display mode switching
[LWJGL] XF86VidMode extension version 2.2
[LWJGL] Initial mode: 1920 x 1200 x 24 @50Hz
1920 x 1200 x 24 @50Hz
[LWJGL] Pixel format info: r = 8, g = 8, b = 8, a = 0, depth = 24, stencil = 0, sample buffers = 0, samples = 0
[LWJGL] MemoryUtil Accessor: AccessorUnsafe
Could not locate symbol glProgramUniform1dEXT
Could not locate symbol glProgramUniform2dEXT
Could not locate symbol glProgramUniform3dEXT
Could not locate symbol glProgramUniform4dEXT
Could not locate symbol glProgramUniform1dvEXT
Could not locate symbol glProgramUniform2dvEXT
Could not locate symbol glProgramUniform3dvEXT
Could not locate symbol glProgramUniform4dvEXT
Could not locate symbol glProgramUniformMatrix2dvEXT
Could not locate symbol glProgramUniformMatrix3dvEXT
Could not locate symbol glProgramUniformMatrix4dvEXT
Could not locate symbol glProgramUniformMatrix2x3dvEXT
Could not locate symbol glProgramUniformMatrix2x4dvEXT
Could not locate symbol glProgramUniformMatrix3x2dvEXT
Could not locate symbol glProgramUniformMatrix3x4dvEXT
Could not locate symbol glProgramUniformMatrix4x2dvEXT
Could not locate symbol glProgramUniformMatrix4x3dvEXT
[LWJGL] GL_ARB_gpu_shader_fp64 was reported as available but an entry point is missing
Could not locate symbol glVertexWeighthNV
[LWJGL] XF86VidMode extension version 2.2
[localhost gl]$


Any ideas? "[LWJGL] Did not match: primary" seems important..
Title: Re: [BUG] Mode switching on close, even in window mode?
Post by: _SA_ on March 24, 2013, 14:49:29
I have the same problem, recorded it: https://www.youtube.com/watch?v=3vb5ZKoAE8Y (https://www.youtube.com/watch?v=3vb5ZKoAE8Y)
This only happens with LWJGL, not OpenGL.
Using xorg 1.14 though.
Title: Re: [BUG] Mode switching on close, even in window mode?
Post by: tulius on April 26, 2013, 15:15:44
I still have this with Xorg 1.14.1

My Game uses LWJGL 2.9.0, but this also happens with older versions and other games (Minecraft)

Output with org.lwjgl.util.Debug=true:
[LWJGL] Xrandr extension version 1.4
[LWJGL] Using Xrandr for display mode switching
[LWJGL] Did not match: (normal
[LWJGL] Did not match: primary
[LWJGL] XF86VidMode extension version 2.2
[LWJGL] Initial mode: 1920 x 1080 x 24 @55Hz
[LWJGL] Pixel format info: r = 8, g = 8, b = 8, a = 8, depth = 24, stencil = 8, sample buffers = 0, samples = 0
[LWJGL] MemoryUtil Accessor: AccessorUnsafe
Could not locate symbol glVertexWeighthNV

(unrelated game output here, the following prints on exit)

[LWJGL] Mode 0: 1280x720 @51
[LWJGL] Mode 1: 1024x768 @52
[LWJGL] Mode 2: 800x600 @53
[LWJGL] Mode 3: 640x480 @54
[LWJGL] Mode 4: 1920x1080 @55
[LWJGL] XF86VidMode extension version 2.2


Closing the windowed game causes a mode switch that leaves me with a black screen for several seconds (while my monitor re-establishes the HDMI connection)

I am running a fully updated Arch Linux x64 with proprietary nvidia drivers (313.30) on kernel 3.8.8
This both happens with KDE/Kwin compositing ("desktop effects") enabled and disabled.

Some thoughts:
- I find "Did not match: (normal" and "Did not match: primary" very suspicious - what do they mean, exactly?
- "Initial mode: 1920 x 1080 x 24 @55Hz" is wrong, the external monitor is running @60Hz. The driver doesn't even let me switch to 55Hz.
- Display.getAvailableDisplayModes() returns suspicious results as well, I get:
1024 x 768 x 24 @52Hz
1920 x 1080 x 24 @55Hz
800 x 600 x 24 @53Hz
1280 x 720 x 24 @51Hz
640 x 480 x 24 @54Hz

- xrandr, however does return valid modes:
DP-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080      60.0*+   60.0     59.9     50.0     60.1     60.0     50.0 
   1680x1050      60.0 
   1600x1200      60.0 
   1440x900       59.9 
   1366x768       59.8 
   1280x1024      75.0     60.0 
   1280x960       60.0 
   1280x720       60.0     59.9     50.0 
   1152x864       75.0 
   1024x768       75.0     70.1     60.0 
   800x600        75.0     72.2     60.3     56.2 
   720x576        50.0 
   720x480        59.9 
   640x480        75.0     72.8     59.9     59.9


Any ideas if this is a kernel, nvidia, X11, xrandr or LWJGL issue?
Title: Re: [BUG] Mode switching on close, even in window mode?
Post by: tulius on April 27, 2013, 20:30:29
I digged into this and fixed it.
Pull Request: https://github.com/LWJGL/lwjgl/pull/26
Title: Re: [BUG] Mode switching on close, even in window mode?
Post by: tulius on April 28, 2013, 14:34:31
Pull Request was accepted, fixed in latest nightly.

@moderator: This topic can be moved to resolved.
Title: Re: [FIXED] Mode switching on close, even in window mode?
Post by: kappa on April 28, 2013, 14:40:10
Good job, thanks for the fix.