mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Add window hints for initial position
This adds window hints for the initial position, in screen coordinates, of a window. The special value GLFW_ANY_POSITION means the window manager will be allowed to position the window. It is not possible to set window positions on Wayland and GLFW will always behave as if these hints are set to GLFW_ANY_POSITION. Fixes #1603 Fixes #1747
This commit is contained in:
@@ -274,6 +274,8 @@ void glfwDefaultWindowHints(void)
|
||||
_glfw.hints.window.autoIconify = GLFW_TRUE;
|
||||
_glfw.hints.window.centerCursor = GLFW_TRUE;
|
||||
_glfw.hints.window.focusOnShow = GLFW_TRUE;
|
||||
_glfw.hints.window.xpos = GLFW_ANY_POSITION;
|
||||
_glfw.hints.window.ypos = GLFW_ANY_POSITION;
|
||||
|
||||
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
|
||||
// double buffered
|
||||
@@ -368,6 +370,12 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
||||
case GLFW_VISIBLE:
|
||||
_glfw.hints.window.visible = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_POSITION_X:
|
||||
_glfw.hints.window.xpos = value;
|
||||
return;
|
||||
case GLFW_POSITION_Y:
|
||||
_glfw.hints.window.ypos = value;
|
||||
return;
|
||||
case GLFW_COCOA_RETINA_FRAMEBUFFER:
|
||||
_glfw.hints.window.ns.retina = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user