1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Fix NET_WM_STATE clobbering at creation

This commit is contained in:
Camilla Berglund 2016-05-03 11:38:45 +02:00
parent 6fcedb5396
commit 211bdab51f

View File

@ -464,32 +464,32 @@ static GLFWbool createWindow(_GLFWwindow* window,
sizeof(hints) / sizeof(long)); sizeof(hints) / sizeof(long));
} }
if (_glfw.x11.NET_WM_STATE && !window->monitor)
{
Atom states[3];
int count = 0;
if (wndconfig->floating) if (wndconfig->floating)
{ {
if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_ABOVE) if (_glfw.x11.NET_WM_STATE_ABOVE)
{ states[count++] = _glfw.x11.NET_WM_STATE_ABOVE;
Atom value = _glfw.x11.NET_WM_STATE_ABOVE;
XChangeProperty(_glfw.x11.display, window->x11.handle,
_glfw.x11.NET_WM_STATE, XA_ATOM, 32,
PropModeReplace, (unsigned char*) &value, 1);
}
} }
if (wndconfig->maximized && !window->monitor) if (wndconfig->maximized)
{ {
if (_glfw.x11.NET_WM_STATE && if (_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT &&
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ) _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ)
{ {
const Atom states[2] = states[count++] = _glfw.x11.NET_WM_STATE_MAXIMIZED_VERT;
{ states[count++] = _glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ;
_glfw.x11.NET_WM_STATE_MAXIMIZED_VERT, }
_glfw.x11.NET_WM_STATE_MAXIMIZED_HORZ }
};
if (count)
{
XChangeProperty(_glfw.x11.display, window->x11.handle, XChangeProperty(_glfw.x11.display, window->x11.handle,
_glfw.x11.NET_WM_STATE, XA_ATOM, 32, _glfw.x11.NET_WM_STATE, XA_ATOM, 32,
PropModeReplace, (unsigned char*) &states, 2); PropModeReplace, (unsigned char*) &states, count);
} }
} }