mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-26 04:05:36 +00:00
Fixed another NRE in TryChangeResolution.
This commit is contained in:
parent
def502a3e2
commit
55dd09a450
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue