[Linux] Fixed GameWindow.ClientSize values.

This commit is contained in:
thefiddler 2014-07-16 11:34:01 +02:00
parent bef4901659
commit e61b39a1a1

View file

@ -55,11 +55,23 @@ namespace OpenTK.Platform.Linux
Debug.Print("[KMS] Creating window on display {0:x}", display);
Title = title;
bounds = new Rectangle(0, 0, width, height);
client_size = bounds.Size;
display_device = display_device ?? DisplayDevice.Default;
if (display_device == null)
{
throw new NotSupportedException("[KMS] Driver does not currently support headless systems");
}
window = new LinuxWindowInfo(display, fd, display_device.Id as LinuxDisplay);
// Note: we only support fullscreen windows on KMS.
// We implicitly override the requested width and height
// by the width and height of the DisplayDevice, if any.
width = display_device.Width;
height = display_device.Height;
bounds = new Rectangle(0, 0, width, height);
client_size = bounds.Size;
if (!mode.Index.HasValue)
{
mode = new EglGraphicsMode().SelectGraphicsMode(window, mode, 0);
@ -74,15 +86,6 @@ namespace OpenTK.Platform.Linux
format = SurfaceFormat.XRGB8888;
}
// Note: we only support fullscreen windows on KMS.
// We implicitly override the requested width and height
// by the width and height of the DisplayDevice, if any.
if (display_device != null)
{
width = display_device.Width;
height = display_device.Height;
}
Debug.Print("[KMS] Creating GBM surface on {0:x} with {1}x{2} {3} [{4}]",
gbm, width, height, format, usage);
IntPtr gbm_surface = Gbm.CreateSurface(gbm,