mirror of
https://github.com/glfw/glfw.git
synced 2026-09-20 16:30:45 +00:00
@@ -1155,6 +1155,12 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
_glfwInputWindowVisibility(window, GL_TRUE);
|
||||
}
|
||||
|
||||
void _glfwPlatformUnhideWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object orderFront:nil];
|
||||
_glfwInputWindowVisibility(window, GL_TRUE);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object orderOut:nil];
|
||||
|
||||
@@ -152,6 +152,7 @@ struct _GLFWwndconfig
|
||||
GLboolean resizable;
|
||||
GLboolean visible;
|
||||
GLboolean decorated;
|
||||
GLboolean focused;
|
||||
GLboolean autoIconify;
|
||||
GLboolean floating;
|
||||
_GLFWmonitor* monitor;
|
||||
@@ -326,6 +327,7 @@ struct _GLFWlibrary
|
||||
int resizable;
|
||||
int visible;
|
||||
int decorated;
|
||||
int focused;
|
||||
int autoIconify;
|
||||
int floating;
|
||||
int samples;
|
||||
@@ -562,6 +564,10 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window);
|
||||
*/
|
||||
void _glfwPlatformShowWindow(_GLFWwindow* window);
|
||||
|
||||
/*! @ingroup platform
|
||||
*/
|
||||
void _glfwPlatformUnhideWindow(_GLFWwindow* window);
|
||||
|
||||
/*! @copydoc glfwHideWindow
|
||||
* @ingroup platform
|
||||
*/
|
||||
|
||||
@@ -1183,6 +1183,11 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
SetFocus(window->win32.handle);
|
||||
}
|
||||
|
||||
void _glfwPlatformUnhideWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_SHOW);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_HIDE);
|
||||
|
||||
+15
-2
@@ -163,6 +163,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
wndconfig.resizable = _glfw.hints.resizable ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.visible = _glfw.hints.visible ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.decorated = _glfw.hints.decorated ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.focused = _glfw.hints.focused ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.autoIconify = _glfw.hints.autoIconify ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.floating = _glfw.hints.floating ? GL_TRUE : GL_FALSE;
|
||||
wndconfig.monitor = (_GLFWmonitor*) monitor;
|
||||
@@ -190,6 +191,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
{
|
||||
wndconfig.resizable = GL_TRUE;
|
||||
wndconfig.visible = GL_TRUE;
|
||||
wndconfig.focused = GL_TRUE;
|
||||
|
||||
// Set up desired video mode
|
||||
window->videoMode.width = width;
|
||||
@@ -200,6 +202,8 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
window->videoMode.refreshRate = _glfw.hints.refreshRate;
|
||||
}
|
||||
|
||||
// Transfer window hints that are persistent settings and not
|
||||
// just initial states
|
||||
window->monitor = wndconfig.monitor;
|
||||
window->resizable = wndconfig.resizable;
|
||||
window->decorated = wndconfig.decorated;
|
||||
@@ -257,7 +261,12 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
else
|
||||
{
|
||||
if (wndconfig.visible)
|
||||
_glfwPlatformShowWindow(window);
|
||||
{
|
||||
if (wndconfig.focused)
|
||||
_glfwPlatformShowWindow(window);
|
||||
else
|
||||
_glfwPlatformUnhideWindow(window);
|
||||
}
|
||||
}
|
||||
|
||||
return (GLFWwindow*) window;
|
||||
@@ -274,10 +283,11 @@ void glfwDefaultWindowHints(void)
|
||||
_glfw.hints.major = 1;
|
||||
_glfw.hints.minor = 0;
|
||||
|
||||
// The default is a visible, resizable window with decorations
|
||||
// The default is a focused, visible, resizable window with decorations
|
||||
_glfw.hints.resizable = GL_TRUE;
|
||||
_glfw.hints.visible = GL_TRUE;
|
||||
_glfw.hints.decorated = GL_TRUE;
|
||||
_glfw.hints.focused = GL_TRUE;
|
||||
_glfw.hints.autoIconify = GL_TRUE;
|
||||
|
||||
// The default is 24 bits of color, 24 bits of depth and 8 bits of stencil,
|
||||
@@ -345,6 +355,9 @@ GLFWAPI void glfwWindowHint(int target, int hint)
|
||||
case GLFW_DECORATED:
|
||||
_glfw.hints.decorated = hint;
|
||||
break;
|
||||
case GLFW_FOCUSED:
|
||||
_glfw.hints.focused = hint;
|
||||
break;
|
||||
case GLFW_AUTO_ICONIFY:
|
||||
_glfw.hints.autoIconify = hint;
|
||||
break;
|
||||
|
||||
@@ -325,6 +325,12 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
wl_shell_surface_set_toplevel(window->wl.shell_surface);
|
||||
}
|
||||
|
||||
void _glfwPlatformUnhideWindow(_GLFWwindow* window)
|
||||
{
|
||||
// TODO
|
||||
fprintf(stderr, "_glfwPlatformUnhideWindow not implemented yet\n");
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
wl_surface_attach(window->wl.surface, NULL, 0, 0);
|
||||
|
||||
@@ -1577,6 +1577,12 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
XFlush(_glfw.x11.display);
|
||||
}
|
||||
|
||||
void _glfwPlatformUnhideWindow(_GLFWwindow* window)
|
||||
{
|
||||
XMapWindow(_glfw.x11.display, window->x11.handle);
|
||||
XFlush(_glfw.x11.display);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
XUnmapWindow(_glfw.x11.display, window->x11.handle);
|
||||
|
||||
Reference in New Issue
Block a user