瀏覽代碼

Fixed window position for EWMH full screen.

Also added flushing after setting window position and size.
Camilla Berglund 12 年之前
父節點
當前提交
67e7d8ca5f
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/x11_window.c

+ 7 - 0
src/x11_window.c

@@ -362,6 +362,10 @@ static void enterFullscreenMode(_GLFWwindow* window)
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE != None &&
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)
         _glfw.x11.NET_WM_STATE_FULLSCREEN != None)
     {
     {
+        int x, y;
+        _glfwPlatformGetMonitorPos(window->monitor, &x, &y);
+        _glfwPlatformSetWindowPos(window, x, y);
+
         if (_glfw.x11.NET_ACTIVE_WINDOW != None)
         if (_glfw.x11.NET_ACTIVE_WINDOW != None)
         {
         {
             // Ask the window manager to raise and focus the GLFW window
             // Ask the window manager to raise and focus the GLFW window
@@ -961,6 +965,7 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
 void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
 void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
 {
 {
     XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos);
     XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos);
+    XFlush(_glfw.x11.display);
 }
 }
 
 
 void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
 void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
@@ -1004,6 +1009,8 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
     }
     }
     else
     else
         XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);
         XResizeWindow(_glfw.x11.display, window->x11.handle, width, height);
+
+    XFlush(_glfw.x11.display);
 }
 }
 
 
 void _glfwPlatformIconifyWindow(_GLFWwindow* window)
 void _glfwPlatformIconifyWindow(_GLFWwindow* window)