Fixed position of fullscreen windows on X11.

This commit is contained in:
Camilla Berglund 2012-10-21 23:44:10 +02:00
parent c3195746d8
commit 8176cae1bc
1 changed files with 9 additions and 12 deletions

View File

@ -98,8 +98,6 @@ static GLboolean createWindow(_GLFWwindow* window,
// Create the actual window
{
int screenX, screenY;
wamask = CWBorderPixel | CWColormap | CWEventMask;
wa.colormap = window->X11.colormap;
@ -109,12 +107,7 @@ static GLboolean createWindow(_GLFWwindow* window,
ExposureMask | FocusChangeMask | VisibilityChangeMask |
EnterWindowMask | LeaveWindowMask;
if (wndconfig->monitor)
{
screenX = wndconfig->monitor->screenX;
screenY = wndconfig->monitor->screenY;
}
else
if (wndconfig->monitor == NULL)
{
// The /only/ reason for setting the background pixel here is that
// otherwise our window won't get any decorations on systems using
@ -122,14 +115,11 @@ static GLboolean createWindow(_GLFWwindow* window,
wa.background_pixel = BlackPixel(_glfwLibrary.X11.display,
_glfwLibrary.X11.screen);
wamask |= CWBackPixel;
screenX = 0;
screenY = 0;
}
window->X11.handle = XCreateWindow(_glfwLibrary.X11.display,
_glfwLibrary.X11.root,
screenX, screenY,
0, 0,
window->width, window->height,
0, // Border width
visual->depth, // Color depth
@ -225,6 +215,13 @@ static GLboolean createWindow(_GLFWwindow* window,
hints->flags = 0;
if (wndconfig->monitor)
{
hints->flags |= PPosition;
hints->x = wndconfig->monitor->screenX;
hints->y = wndconfig->monitor->screenY;
}
if (!wndconfig->resizable)
{
hints->flags |= (PMinSize | PMaxSize);