From 87e925f0578c3bed72dfc69b8854432b3aa69266 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 4 Aug 2009 09:35:31 +0000 Subject: [PATCH] Merged improved XRandR handling from 0.9.8 branch. --- Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs index 7a08758c..317c7889 100644 --- a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs +++ b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs @@ -55,6 +55,11 @@ namespace OpenTK.Platform.X11 int resolution_count = 0; foreach (XRRScreenSize size in FindAvailableResolutions(screen)) { + if (size.Width == 0 || size.Height == 0) + { + Debug.Print("[Warning] XRandR returned an invalid resolution ({0}) for display device {1}", size, screen); + continue; + } short[] rates = Functions.XRRRates(API.DefaultDisplay, screen, resolution_count); // It seems that XRRRates returns 0 for modes that are larger than the screen