| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -121,7 +121,7 @@ static GLboolean createWindow(_GLFWwindow* window, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        window->x11.handle = XCreateWindow(_glfw.x11.display, | 
					 | 
					 | 
					 | 
					        window->x11.handle = XCreateWindow(_glfw.x11.display, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           _glfw.x11.root, | 
					 | 
					 | 
					 | 
					                                           _glfw.x11.root, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           wndconfig->positionX, wndconfig->positionY, | 
					 | 
					 | 
					 | 
					                                           wndconfig->positionX, wndconfig->positionY, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           window->width, window->height, | 
					 | 
					 | 
					 | 
					                                           wndconfig->width, wndconfig->height, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           0,              // Border width
 | 
					 | 
					 | 
					 | 
					                                           0,              // Border width
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           visual->depth,  // Color depth
 | 
					 | 
					 | 
					 | 
					                                           visual->depth,  // Color depth
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                           InputOutput, | 
					 | 
					 | 
					 | 
					                                           InputOutput, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -227,8 +227,8 @@ static GLboolean createWindow(_GLFWwindow* window, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (!wndconfig->resizable) | 
					 | 
					 | 
					 | 
					        if (!wndconfig->resizable) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            hints->flags |= (PMinSize | PMaxSize); | 
					 | 
					 | 
					 | 
					            hints->flags |= (PMinSize | PMaxSize); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            hints->min_width  = hints->max_width  = window->width; | 
					 | 
					 | 
					 | 
					            hints->min_width  = hints->max_width  = wndconfig->width; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            hints->min_height = hints->max_height = window->height; | 
					 | 
					 | 
					 | 
					            hints->min_height = hints->max_height = wndconfig->height; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints); | 
					 | 
					 | 
					 | 
					        XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -392,12 +392,15 @@ static void enterFullscreenMode(_GLFWwindow* window) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // In override-redirect mode we have divorced ourselves from the
 | 
					 | 
					 | 
					 | 
					        // In override-redirect mode we have divorced ourselves from the
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // window manager, so we need to do everything manually
 | 
					 | 
					 | 
					 | 
					        // window manager, so we need to do everything manually
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        GLFWvidmode mode; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        _glfwPlatformGetVideoMode(window->monitor, &mode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XRaiseWindow(_glfw.x11.display, window->x11.handle); | 
					 | 
					 | 
					 | 
					        XRaiseWindow(_glfw.x11.display, window->x11.handle); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XSetInputFocus(_glfw.x11.display, window->x11.handle, | 
					 | 
					 | 
					 | 
					        XSetInputFocus(_glfw.x11.display, window->x11.handle, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                       RevertToParent, CurrentTime); | 
					 | 
					 | 
					 | 
					                       RevertToParent, CurrentTime); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XMoveWindow(_glfw.x11.display, window->x11.handle, 0, 0); | 
					 | 
					 | 
					 | 
					        XMoveWindow(_glfw.x11.display, window->x11.handle, 0, 0); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XResizeWindow(_glfw.x11.display, window->x11.handle, | 
					 | 
					 | 
					 | 
					        XResizeWindow(_glfw.x11.display, window->x11.handle, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                      window->width, window->height); | 
					 | 
					 | 
					 | 
					                      mode.width, mode.height); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -893,10 +896,19 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) | 
					 | 
					 | 
					 | 
					void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					{ | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    GLboolean sizeChanged = GL_FALSE; | 
					 | 
					 | 
					 | 
					    XWindowAttributes attribs; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    XGetWindowAttributes(_glfw.x11.display, window->x11.handle, &attribs); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (width) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        *width = attribs.width; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if (height) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        *height = attribs.height; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					{ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!window->resizable) | 
					 | 
					 | 
					 | 
					    if (!window->resizable) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // Update window size restrictions to match new window size
 | 
					 | 
					 | 
					 | 
					        // Update window size restrictions to match new window size
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -913,18 +925,17 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (window->monitor) | 
					 | 
					 | 
					 | 
					    if (window->monitor) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    { | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        // Change window size before changing fullscreen mode?
 | 
					 | 
					 | 
					 | 
					        if (window->x11.overrideRedirect) | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (width > window->width) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            XResizeWindow(_glfw.x11.display, window->x11.handle, width, height); | 
					 | 
					 | 
					 | 
					            GLFWvidmode mode; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            sizeChanged = GL_TRUE; | 
					 | 
					 | 
					 | 
					            _glfwPlatformGetVideoMode(window->monitor, &mode); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            XResizeWindow(_glfw.x11.display, window->x11.handle, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                          window->videoMode.width, window->videoMode.height); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        _glfwSetVideoMode(window->monitor, &window->videoMode); | 
					 | 
					 | 
					 | 
					        _glfwSetVideoMode(window->monitor, &window->videoMode); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					    else | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    // Set window size (if not already changed)
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if (!sizeChanged) | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        XResizeWindow(_glfw.x11.display, window->x11.handle, width, height); | 
					 | 
					 | 
					 | 
					        XResizeWindow(_glfw.x11.display, window->x11.handle, width, height); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -993,9 +1004,9 @@ void _glfwPlatformPollEvents(void) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (window->cursorMode == GLFW_CURSOR_CAPTURED && | 
					 | 
					 | 
					 | 
					        if (window->cursorMode == GLFW_CURSOR_CAPTURED && | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            !window->x11.cursorCentered) | 
					 | 
					 | 
					 | 
					            !window->x11.cursorCentered) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        { | 
					 | 
					 | 
					 | 
					        { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            _glfwPlatformSetCursorPos(window, | 
					 | 
					 | 
					 | 
					            int width, height; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                      window->width / 2, | 
					 | 
					 | 
					 | 
					            _glfwPlatformGetWindowSize(window, &width, &height); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                      window->height / 2); | 
					 | 
					 | 
					 | 
					            _glfwPlatformSetCursorPos(window, width / 2, height / 2); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            window->x11.cursorCentered = GL_TRUE; | 
					 | 
					 | 
					 | 
					            window->x11.cursorCentered = GL_TRUE; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // NOTE: This is a temporary fix.  It works as long as you use
 | 
					 | 
					 | 
					 | 
					            // NOTE: This is a temporary fix.  It works as long as you use
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |