1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-27 04:28:52 -05:00

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

View File

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