Permalink
Browse files

[Linux] Fixed GameWindow.ClientSize values.

  • Loading branch information...
thefiddler committed Jul 16, 2014
1 parent bef4901 commit e61b39a1a1b354ffbc461607e6db9eec14de7199
Showing with 14 additions and 11 deletions.
  1. +14 −11 Source/OpenTK/Platform/Linux/LinuxNativeWindow.cs
@@ -55,11 +55,23 @@ class LinuxNativeWindow : NativeWindowBase
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 @@ class LinuxNativeWindow : NativeWindowBase
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,

0 comments on commit e61b39a

Please sign in to comment.