From 989f22dc75a3a1d015de071a6fab7afedae8a315 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 26 Jan 2008 10:45:13 +0000 Subject: [PATCH] Fixed another NRE in TryChangeResolution. --- Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs index 1fbc06a6..fcbd2d72 100644 --- a/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs +++ b/Source/OpenTK/Platform/X11/X11XrandrDisplayDevice.cs @@ -162,13 +162,13 @@ namespace OpenTK.Platform.X11 screen, current_resolution_index, new_resolution_index); return 0 == Functions.XRRSetScreenConfigAndRate(API.DefaultDisplay, screen_config, root, new_resolution_index, - current_rotation, (short)resolution.RefreshRate, lastConfigUpdate[screen]); + current_rotation, (short)(resolution != null ? resolution.RefreshRate : 0), lastConfigUpdate[screen]); } public void RestoreResolution(DisplayDevice device) { - //TryChangeResolution(device, null); - System.Diagnostics.Process.Start("xrandr", "-s -0").WaitForExit(); + TryChangeResolution(device, null); + //System.Diagnostics.Process.Start("xrandr", "-s -0").WaitForExit(); // Hack, but works ;) } #endregion