mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Removed glfwSetWindowPos and glfwGetWindowPos
glfwGetWindowPos is superseded by glfwGetWindowParam() with GLFW_POSITION_X and GLFW_POSITION_Y as parameters. glfwSetWindowPos can easily lead to bad practices (moving windows around without the users consent), and has been replaced with the GLFW_POSITION_X/Y window hints that allow setting the window position for a newly created window.
This commit is contained in:
@@ -1006,27 +1006,6 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Set the window position
|
||||
//========================================================================
|
||||
|
||||
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y)
|
||||
{
|
||||
NSRect contentRect =
|
||||
[window->NS.object contentRectForFrameRect:[window->NS.object frame]];
|
||||
|
||||
// We assume here that the client code wants to position the window within the
|
||||
// screen the window currently occupies
|
||||
NSRect screenRect = [[window->NS.object screen] visibleFrame];
|
||||
contentRect.origin = NSMakePoint(screenRect.origin.x + x,
|
||||
screenRect.origin.y + screenRect.size.height -
|
||||
y - contentRect.size.height);
|
||||
|
||||
[window->NS.object setFrame:[window->NS.object frameRectForContentRect:contentRect]
|
||||
display:YES];
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Iconify the window
|
||||
//========================================================================
|
||||
|
||||
Reference in New Issue
Block a user