File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,18 +79,23 @@ public MainWindow()
7979
8080 private void UpdateConfigView ( )
8181 {
82- int idx ;
83- if ( this . Configuration . GraphicsAdapter != null && ( idx = this . GPUSelector . Items . IndexOf ( this . Configuration . GraphicsAdapter ) ) >= 0 )
82+ int idx = this . GPUSelector . Items . IndexOf ( null ) ;
83+ if ( idx >= 0 )
8484 {
8585 this . GPUSelector . SelectedIndex = idx ;
86+
8687 this . ResSelector . ItemsSource = ( ( GraphicsAdapter ) this . GPUSelector . SelectedItem ) . Resolutions ;
87- idx = this . ResSelector . Items . IndexOf ( this . Configuration . Resolution ) ; // We do this to not lose the Refresh Rate
88- this . ResSelector . SelectedIndex = idx ;
88+ idx = this . ResSelector . Items . IndexOf ( this . Configuration . Resolution ) ; // We do this to not lose the Refresh Rate
89+ this . ResSelector . SelectedIndex = idx >= 0 ? idx : 0 ;
8990
91+ this . RefreshRateSelector . ItemsSource = ( ( Resolution ) this . ResSelector . SelectedItem ) . RefreshRates ;
9092 if ( idx >= 0 )
9193 {
92- this . RefreshRateSelector . ItemsSource = ( ( Resolution ) this . ResSelector . SelectedItem ) . RefreshRates ;
9394 this . RefreshRateSelector . SelectedItem = this . Configuration . RefreshRate ;
95+ }
96+ else
97+ {
98+ this . RefreshRateSelector . SelectedIndex = 0 ;
9499 }
95100 }
96101 else
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public override bool Equals(object obj)
2020 {
2121 GraphicsAdapter adapter = ( GraphicsAdapter ) obj ;
2222 return Description . Equals ( adapter . Description ) &&
23- MonitorID . Equals ( adapter . MonitorID ) &&
23+ Name . Equals ( adapter . Name ) &&
2424 GUID . Equals ( adapter . GUID ) ;
2525 }
2626
You can’t perform that action at this time.
0 commit comments