Pārlūkot izejas kodu

Improve placement when forcing windowed mode

This is a temporary fix while waiting the for workarea query.

Related to #1106.
Camilla Löwy 7 gadi atpakaļ
vecāks
revīzija
7b877c4e24
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      src/monitor.c

+ 3 - 1
src/monitor.c

@@ -113,9 +113,11 @@ void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement)
         {
         {
             if (window->monitor == monitor)
             if (window->monitor == monitor)
             {
             {
-                int width, height;
+                int width, height, xoff, yoff;
                 _glfwPlatformGetWindowSize(window, &width, &height);
                 _glfwPlatformGetWindowSize(window, &width, &height);
                 _glfwPlatformSetWindowMonitor(window, NULL, 0, 0, width, height, 0);
                 _glfwPlatformSetWindowMonitor(window, NULL, 0, 0, width, height, 0);
+                _glfwPlatformGetWindowFrameSize(window, &xoff, &yoff, NULL, NULL);
+                _glfwPlatformSetWindowPos(window, xoff, yoff);
             }
             }
         }
         }