Add glfwRequestWindowAttention

Related to #988.
This commit is contained in:
Felipe Ferreira da Silva
2017-03-21 10:02:57 -03:00
committed by Camilla Löwy
parent 4e8e25a521
commit 412eb6a611
12 changed files with 74 additions and 0 deletions
+15
View File
@@ -2077,6 +2077,21 @@ void _glfwPlatformHideWindow(_GLFWwindow* window)
XFlush(_glfw.x11.display);
}
void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
{
XEvent xev;
memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
xev.xclient.window = window->x11.handle;
xev.xclient.message_type = _glfw.x11.NET_WM_STATE;
xev.xclient.format = 32;
xev.xclient.data.l[0] = _NET_WM_STATE_ADD;
xev.xclient.data.l[1] = _glfw.x11.NET_WM_STATE_DEMANDS_ATTENTION;
XSendEvent(_glfw.x11.display, DefaultRootWindow(_glfw.x11.display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
}
void _glfwPlatformFocusWindow(_GLFWwindow* window)
{
if (_glfw.x11.NET_ACTIVE_WINDOW)