Fixed another NRE in TryChangeResolution.

This commit is contained in:
the_fiddler 2008-01-26 10:45:13 +00:00
parent def502a3e2
commit 55dd09a450

View file

@ -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