Skip to content

Commit cb7c5df

Browse files
committed
Keep using the display name for comparison purposes
1 parent ce97f87 commit cb7c5df

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎GensConfigTool/MainWindow.xaml.cs‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff 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

‎GensConfigTool/Model/Devices/GraphicsAdapter.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)