{"action":"created","issue":{"url":"https://api.github.com/repos/glfw/glfw/issues/626","repository_url":"https://api.github.com/repos/glfw/glfw","labels_url":"https://api.github.com/repos/glfw/glfw/issues/626/labels{/name}","comments_url":"https://api.github.com/repos/glfw/glfw/issues/626/comments","events_url":"https://api.github.com/repos/glfw/glfw/issues/626/events","html_url":"https://github.com/glfw/glfw/issues/626","id":113745424,"number":626,"title":"setting window position sets the window decoration pos instead of client area pos","user":{"login":"andrewrk","id":106511,"avatar_url":"https://avatars.githubusercontent.com/u/106511?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewrk","html_url":"https://github.com/andrewrk","followers_url":"https://api.github.com/users/andrewrk/followers","following_url":"https://api.github.com/users/andrewrk/following{/other_user}","gists_url":"https://api.github.com/users/andrewrk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewrk/subscriptions","organizations_url":"https://api.github.com/users/andrewrk/orgs","repos_url":"https://api.github.com/users/andrewrk/repos","events_url":"https://api.github.com/users/andrewrk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewrk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/glfw/glfw/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/glfw/glfw/labels/X11","name":"X11","color":"3b80ae"}],"state":"open","locked":false,"assignee":{"login":"elmindreda","id":133714,"avatar_url":"https://avatars.githubusercontent.com/u/133714?v=3","gravatar_id":"","url":"https://api.github.com/users/elmindreda","html_url":"https://github.com/elmindreda","followers_url":"https://api.github.com/users/elmindreda/followers","following_url":"https://api.github.com/users/elmindreda/following{/other_user}","gists_url":"https://api.github.com/users/elmindreda/gists{/gist_id}","starred_url":"https://api.github.com/users/elmindreda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmindreda/subscriptions","organizations_url":"https://api.github.com/users/elmindreda/orgs","repos_url":"https://api.github.com/users/elmindreda/repos","events_url":"https://api.github.com/users/elmindreda/events{/privacy}","received_events_url":"https://api.github.com/users/elmindreda/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-10-28T05:13:35Z","updated_at":"2016-02-28T19:11:06Z","closed_at":null,"body":"Here's my test (against 43f4afef which is current master):\r\n\r\n```diff\r\ndiff --git a/examples/simple.c b/examples/simple.c\r\nindex 37cf105..ff82ede 100644\r\n--- a/examples/simple.c\r\n+++ b/examples/simple.c\r\n@@ -30,6 +30,9 @@\r\n #include <stdlib.h>\r\n #include <stdio.h>\r\n \r\n+int hardcoded_left = 50;\r\n+int hardcoded_top = 50;\r\n+\r\n static void error_callback(int error, const char* description)\r\n {\r\n     fputs(description, stderr);\r\n@@ -41,6 +44,10 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,\r\n         glfwSetWindowShouldClose(window, GLFW_TRUE);\r\n }\r\n \r\n+static void window_pos_callback(GLFWwindow* window, int left, int top) {\r\n+    fprintf(stderr, \"window_pos_callback %d %d\\n\", left, top);\r\n+}\r\n+\r\n int main(void)\r\n {\r\n     GLFWwindow* window;\r\n@@ -57,6 +64,15 @@ int main(void)\r\n         exit(EXIT_FAILURE);\r\n     }\r\n \r\n+    fprintf(stderr, \"set to %d %d\\n\", hardcoded_left, hardcoded_top);\r\n+    glfwSetWindowPos(window, hardcoded_left, hardcoded_top);\r\n+\r\n+    int left, top;\r\n+    glfwGetWindowPos(window, &left, &top);\r\n+    fprintf(stderr, \"get pos %d %d\\n\", left, top);\r\n+\r\n+    glfwSetWindowPosCallback(window, window_pos_callback);\r\n+\r\n     glfwMakeContextCurrent(window);\r\n     gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);\r\n     glfwSwapInterval(1);\r\n\r\n```\r\n\r\nOutput:\r\n\r\n```\r\nset to 50 50\r\nget pos -55 -69\r\nwindow_pos_callback 5 19\r\nwindow_pos_callback 55 69\r\n```\r\n\r\nBased on the documentation, I expect `glfwSetWindowPos` to set the x, y location of the client area, not the window decoration area. So when I get the window pos, I expect to get 50, 50 back instead of -55, -69, and then when I get the window pos callback, I expect to again get 50, 50, instead of 55, 69.\r\n\r\nI noticed that if I moved the `glfwSetWindowPos` call to the key callback, it worked as intended.\r\n\r\nIn my application, I'm storing the window position in a configuration file, and this bug causes the window to be offset by an additional 5, 19 every time the user opens the application.\r\n\r\nSystem information:\r\n\r\n```\r\nLinux nixos 4.1.8 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64 GNU/Linux\r\nXFCE 4.12\r\n```"},"comment":{"url":"https://api.github.com/repos/glfw/glfw/issues/comments/189923968","html_url":"https://github.com/glfw/glfw/issues/626#issuecomment-189923968","issue_url":"https://api.github.com/repos/glfw/glfw/issues/626","id":189923968,"user":{"login":"elmindreda","id":133714,"avatar_url":"https://avatars.githubusercontent.com/u/133714?v=3","gravatar_id":"","url":"https://api.github.com/users/elmindreda","html_url":"https://github.com/elmindreda","followers_url":"https://api.github.com/users/elmindreda/followers","following_url":"https://api.github.com/users/elmindreda/following{/other_user}","gists_url":"https://api.github.com/users/elmindreda/gists{/gist_id}","starred_url":"https://api.github.com/users/elmindreda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmindreda/subscriptions","organizations_url":"https://api.github.com/users/elmindreda/orgs","repos_url":"https://api.github.com/users/elmindreda/repos","events_url":"https://api.github.com/users/elmindreda/events{/privacy}","received_events_url":"https://api.github.com/users/elmindreda/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T19:11:05Z","updated_at":"2016-02-28T19:11:05Z","body":"The bogus positions passed to the position callback should be fixed with 6494da3101eba2ad0d9c8b814e98465456c11273. As for the rest, can it still be reproduced? I was unable to reproduce #274 with Xfwm4 4.12 on Ubuntu 15.10 today."}}