From 7b877c4e2450aeba17c0ef3ed9134f69561f8b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Sat, 4 Nov 2017 21:14:06 +0100 Subject: [PATCH] Improve placement when forcing windowed mode This is a temporary fix while waiting the for workarea query. Related to #1106. --- src/monitor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/monitor.c b/src/monitor.c index 0dfb1958..6f64cca5 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -113,9 +113,11 @@ void _glfwInputMonitor(_GLFWmonitor* monitor, int action, int placement) { if (window->monitor == monitor) { - int width, height; + int width, height, xoff, yoff; _glfwPlatformGetWindowSize(window, &width, &height); _glfwPlatformSetWindowMonitor(window, NULL, 0, 0, width, height, 0); + _glfwPlatformGetWindowFrameSize(window, &xoff, &yoff, NULL, NULL); + _glfwPlatformSetWindowPos(window, xoff, yoff); } }