Skip to content

Commit

Permalink
Keep using the display name for comparison purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKay committed Mar 26, 2022
1 parent ce97f87 commit cb7c5df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions GensConfigTool/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,23 @@ public MainWindow()

private void UpdateConfigView()
{
int idx;
if (this.Configuration.GraphicsAdapter != null && (idx = this.GPUSelector.Items.IndexOf(this.Configuration.GraphicsAdapter)) >= 0)
int idx = this.GPUSelector.Items.IndexOf(null);
if (idx >= 0)
{
this.GPUSelector.SelectedIndex = idx;

this.ResSelector.ItemsSource = ((GraphicsAdapter)this.GPUSelector.SelectedItem).Resolutions;
idx = this.ResSelector.Items.IndexOf(this.Configuration.Resolution); // We do this to not lose the Refresh Rate
this.ResSelector.SelectedIndex = idx;
idx = this.ResSelector.Items.IndexOf(this.Configuration.Resolution); // We do this to not lose the Refresh Rate
this.ResSelector.SelectedIndex = idx >= 0 ? idx : 0;

this.RefreshRateSelector.ItemsSource = ((Resolution)this.ResSelector.SelectedItem).RefreshRates;
if (idx >= 0)
{
this.RefreshRateSelector.ItemsSource = ((Resolution)this.ResSelector.SelectedItem).RefreshRates;
this.RefreshRateSelector.SelectedItem = this.Configuration.RefreshRate;
}
else
{
this.RefreshRateSelector.SelectedIndex = 0;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion GensConfigTool/Model/Devices/GraphicsAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override bool Equals(object obj)
{
GraphicsAdapter adapter = (GraphicsAdapter)obj;
return Description.Equals(adapter.Description) &&
MonitorID.Equals(adapter.MonitorID) &&
Name.Equals(adapter.Name) &&
GUID.Equals(adapter.GUID);
}

Expand Down

0 comments on commit cb7c5df

Please sign in to comment.