mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Update attention request
For Cocoa, the attention request is made via the ```NSApp```. The functions for each platform were moved, and the documentation improved.
This commit is contained in:
parent
26628af183
commit
a29f9f5ea4
@ -2698,23 +2698,6 @@ GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
|
||||
*/
|
||||
GLFWAPI void glfwShowWindow(GLFWwindow* window);
|
||||
|
||||
/*! @brief Request attention to the specified window.
|
||||
*
|
||||
* This function makes the specified window to request attention.
|
||||
*
|
||||
* @param[in] window The window to request attention.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup window
|
||||
*/
|
||||
GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window);
|
||||
|
||||
/*! @brief Hides the specified window.
|
||||
*
|
||||
* This function hides the specified window if it was previously visible. If
|
||||
@ -2768,6 +2751,26 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
|
||||
*/
|
||||
GLFWAPI void glfwFocusWindow(GLFWwindow* window);
|
||||
|
||||
/*! @brief Request attention to the specified window.
|
||||
*
|
||||
* This function makes the specified window to request attention.
|
||||
*
|
||||
* @param[in] window The window to request attention.
|
||||
*
|
||||
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
|
||||
* GLFW_PLATFORM_ERROR.
|
||||
*
|
||||
* @remark @macos The attention request will be made for the application and
|
||||
* not the window passed in the argument.
|
||||
*
|
||||
* @thread_safety This function must only be called from the main thread.
|
||||
*
|
||||
* @since Added in version 3.3.
|
||||
*
|
||||
* @ingroup window
|
||||
*/
|
||||
GLFWAPI void glfwRequestWindowAttention(GLFWwindow* window);
|
||||
|
||||
/*! @brief Returns the monitor that the window uses for full screen mode.
|
||||
*
|
||||
* This function returns the handle of the monitor that the specified window is
|
||||
|
@ -1272,16 +1272,16 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
[window->ns.object orderFront:nil];
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object requestUserAttention:NSInformationalRequest];
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
[window->ns.object orderOut:nil];
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
[NSApp requestUserAttention:NSInformationalRequest];
|
||||
}
|
||||
|
||||
void _glfwPlatformFocusWindow(_GLFWwindow* window)
|
||||
{
|
||||
// Make us the active application
|
||||
|
@ -1311,16 +1311,16 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
ShowWindow(window->win32.handle, SW_SHOW);
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
FlashWindow(window->win32.handle, TRUE);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_HIDE);
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
FlashWindow(window->win32.handle, TRUE);
|
||||
}
|
||||
|
||||
void _glfwPlatformFocusWindow(_GLFWwindow* window)
|
||||
{
|
||||
BringWindowToTop(window->win32.handle);
|
||||
|
@ -589,10 +589,6 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (!window->monitor)
|
||||
@ -603,6 +599,10 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
}
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
}
|
||||
|
||||
void _glfwPlatformFocusWindow(_GLFWwindow* window)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
|
@ -2072,6 +2072,12 @@ void _glfwPlatformShowWindow(_GLFWwindow* window)
|
||||
waitForVisibilityNotify(window);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
XUnmapWindow(_glfw.x11.display, window->x11.handle);
|
||||
XFlush(_glfw.x11.display);
|
||||
}
|
||||
|
||||
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
{
|
||||
XEvent xev;
|
||||
@ -2087,12 +2093,6 @@ void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
|
||||
XSendEvent(_glfw.x11.display, DefaultRootWindow(_glfw.x11.display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
|
||||
}
|
||||
|
||||
void _glfwPlatformHideWindow(_GLFWwindow* window)
|
||||
{
|
||||
XUnmapWindow(_glfw.x11.display, window->x11.handle);
|
||||
XFlush(_glfw.x11.display);
|
||||
}
|
||||
|
||||
void _glfwPlatformFocusWindow(_GLFWwindow* window)
|
||||
{
|
||||
if (_glfw.x11.NET_ACTIVE_WINDOW)
|
||||
|
Loading…
Reference in New Issue
Block a user