1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 20:28:49 -05:00

Fixed possible X11 screensaver race condition.

This commit is contained in:
Camilla Berglund 2013-07-04 17:52:15 +02:00
parent 58c69a9ac4
commit dcb4d8ee32
3 changed files with 9 additions and 7 deletions

View File

@ -110,6 +110,8 @@ See the [GLFW 3.0 documentation](http://www.glfw.org/docs/3.0/).
- [Cocoa] Bugfix: Selectors were used that are not declared by the 10.6 SDK
- [X11] Bugfix: Override-redirect windows were resized to the desired instead
of the actual resolution of the selected video mode
- [X11] Bugfix: Screensaver override for full screen windows had a possible
race condition
## Contact

View File

@ -173,7 +173,7 @@ typedef struct _GLFWlibraryX11
int keyCodeLUT[256];
struct {
GLboolean changed;
int count;
int timeout;
int interval;
int blanking;

View File

@ -361,7 +361,7 @@ static void showCursor(_GLFWwindow* window)
//
static void enterFullscreenMode(_GLFWwindow* window)
{
if (!_glfw.x11.saver.changed)
if (_glfw.x11.saver.count == 0)
{
// Remember old screen saver settings
XGetScreenSaver(_glfw.x11.display,
@ -373,10 +373,10 @@ static void enterFullscreenMode(_GLFWwindow* window)
// Disable screen saver
XSetScreenSaver(_glfw.x11.display, 0, 0, DontPreferBlanking,
DefaultExposures);
_glfw.x11.saver.changed = GL_TRUE;
}
_glfw.x11.saver.count++;
_glfwSetVideoMode(window->monitor, &window->videoMode);
if (_glfw.x11.hasEWMH &&
@ -455,7 +455,9 @@ static void leaveFullscreenMode(_GLFWwindow* window)
{
_glfwRestoreVideoMode(window->monitor);
if (_glfw.x11.saver.changed)
_glfw.x11.saver.count--;
if (_glfw.x11.saver.count == 0)
{
// Restore old screen saver settings
XSetScreenSaver(_glfw.x11.display,
@ -463,8 +465,6 @@ static void leaveFullscreenMode(_GLFWwindow* window)
_glfw.x11.saver.interval,
_glfw.x11.saver.blanking,
_glfw.x11.saver.exposure);
_glfw.x11.saver.changed = GL_FALSE;
}
if (_glfw.x11.hasEWMH &&