Skip to content

Qt: remove duplicate entries on resolutions menu#14289

Open
jasaaved wants to merge 1 commit intoPCSX2:masterfrom
jasaaved:resolution-and-frequency-menu-fix
Open

Qt: remove duplicate entries on resolutions menu#14289
jasaaved wants to merge 1 commit intoPCSX2:masterfrom
jasaaved:resolution-and-frequency-menu-fix

Conversation

@jasaaved
Copy link
Copy Markdown

Description of Changes

When querying display information, entries could be duplicated because DXGI returns one entry per combination of scanline ordering and scaling for the same resolution and refresh rate. For example, 1920x1080 @ 60Hz may appear multiple times with combinations such as progressive + unspecified scaling, unspecified + centered scaling, and unspecified + stretched scaling. The UI only showed the resolution and refresh rate so they showed duplicate entries. In code, scanline order and scaling are not used so it didn't matter which of these were picked, so this PR removes those duplicates.

Also added per-monitor grouping to the fullscreen mode list, so users can select a resolution and refresh rate for any connected display, not just their primary.

Rationale behind Changes

Previously, the fullscreen mode dropdown could show duplicate entries for the same resolution and refresh rate. Additionally, users had no way to select modes for a non-primary monitor when launching fullscreen on a secondary display.

Suggested Testing Steps

  1. Open Graphics Settings and navigate to the Display tab.
  2. With a single monitor, verify the fullscreen mode list populates correctly with no duplicate entries.
  3. With multiple monitors, verify each monitor appears as a separate group header with its monitor name or a generic name (if the monitor name is not provided via EDID).

Did you use AI to help find, test, or implement this issue or feature?

Yes for helping with Qt implementation and constructing the friendly name of a monitor.

Before:
image

After:
image

One known issue I have encountered: rendering to main seems to always launch on the primary monitor, so there's no reason to choose a resolution/refresh rate from a secondary monitor in that case. This should be fixed in my other PR for monitor selection, but I can also revert this change in this PR to only show information from the primary monitor.

When querying display information, entries could be duplicated because DXGI returns one entry per combination of scanline ordering and scaling for the same resolution and refresh rate. For example, 1920x1080 @ 60Hz may appear multiple times with combinations such as progressive + unspecified scaling, unspecified + centered scaling, and unspecified + stretched scaling. Since only the resolution and refresh rate are used, duplicates are now excluded.

Also added per-monitor grouping to the fullscreen mode list, so users can select a resolution and refresh rate for any connected display, not just their primary.
@TheLastRar
Copy link
Copy Markdown
Contributor

One known issue I have encountered: rendering to main seems to always launch on the primary monitor...

For me, PCSX2 will fullscreen on the same window that the main window is on, does that not happen for you?

@jasaaved
Copy link
Copy Markdown
Author

does that not happen for you?

No. When I render to main, I could move the main window to my second monitor and it would still launch on my primary. Tried it with a different branch just in case it wasn't the code I did, and I had the same behavior. I'll try again a bit later once I have access to my PC again just to make sure.

Rendering on a separate window works fine though. I can move that to a different monitor, fullscreen it, and it stays there.

@TheLastRar
Copy link
Copy Markdown
Contributor

does that not happen for you?

No. When I render to main, I could move the main window to my second monitor and it would still launch on my primary. Tried it with a different branch just in case it wasn't the code I did, and I had the same behavior. I'll try again a bit later once I have access to my PC again just to make sure.

Rendering on a separate window works fine though. I can move that to a different monitor, fullscreen it, and it stays there.

Assuming you are on Windows (10 or 11?) what are your settings?
Do you start fullscreen set?
What renderer are you using?
What fullscreen mode are you using?

@jasaaved
Copy link
Copy Markdown
Author

Assuming you are on Windows (10 or 11?) what are your settings?
Do you start fullscreen set?
What renderer are you using?
What fullscreen mode are you using?

Windows 11
I believe I tested both starting and not starting fullscreen. Same behavior.
DX12
Exclusive fullscreen with different refresh rates and resolutions. I don't think I tried borderless. I normally use borderless, but for this branch was trying exclusive fullscreen.

@jasaaved
Copy link
Copy Markdown
Author

jasaaved commented Apr 12, 2026

I tested it again, using nightly. I still observe the same behavior. I know the fix for it. I can include in this PR or a separate one without the monitor selector code from my other PR.

@TheLastRar
Copy link
Copy Markdown
Contributor

I tested it again, using nightly. I still observe the same behavior. I know the fix for it. I can include in this PR or a separate one without the monitor selector code from my other PR.

I'm not able to reproduce the issue across 2 different Windows 11 machines using nightly.
What was the fix from your other pr?

@jasaaved
Copy link
Copy Markdown
Author

jasaaved commented Apr 12, 2026

What was the fix from your other pr?

image

Just add the create() call in MainWindow.cpp at line 2586. It forces creation of hwnd early. Qt creates the hwnd in showFullscreen() or showNormal() just a few lines below anyways. I can't tell you why my machine needs the hwnd created early, maybe there's some variation between our machines we don't know. But that early create call fixes my problem.

@TheLastRar
Copy link
Copy Markdown
Contributor

Just add the create() call in MainWindow.cpp at line 2586. It forces creation of hwnd early. Qt creates the hwnd in showFullscreen() or showNormal() just a few lines below anyways. I can't tell you why my machine needs the hwnd created early, maybe there's some variation between our machines we don't know. But that early create call fixes my problem.

Sure, split it off into its own pr and it can be looked at further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants