Skip to content

Qt: Fix Games Not Launching on the Correct Display When Rendering to Main#14292

Open
jasaaved wants to merge 3 commits intoPCSX2:masterfrom
jasaaved:exclusive-fullscreen-main-fix
Open

Qt: Fix Games Not Launching on the Correct Display When Rendering to Main#14292
jasaaved wants to merge 3 commits intoPCSX2:masterfrom
jasaaved:exclusive-fullscreen-main-fix

Conversation

@jasaaved
Copy link
Copy Markdown

@jasaaved jasaaved commented Apr 13, 2026

Description of Changes

Replace setPosition with setGeometry. This makes sure when rendering to main window, it stays on the current display the main window is currently positioned at.

Rationale behind Changes

This fixes the bug where rendering to main a game would launch on the primary monitor instead of the monitor that is currently on. Not everyone may need this fix (see comments under #14289 ). Before testing, make sure your multi-monitor setup needs this fix.

Suggested Testing Steps

  1. Verify "Render to Separate Window " is not turned on in the Interface settings.
  2. Move the main window to a monitor that isn't your primary, start a game, fullscreen it (or Start Fullscreen), and check the main window hasn't moved to your primary monitor.

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

No.

Add an explicit create() call that creates the HWND early . This makes sure when when rendering to main window, it stays on the current display the main window is at. This fixes the bug where rendering to main with exclusive fullscreen would move to the primary monitor.

Not everyone may need this fix. Create() is implicity called in showFullscreen() or showNormal(), but there might be some certain combination of Windows settings or devices that may need it.
@TheLastRar
Copy link
Copy Markdown
Contributor

Just to confirm, the combination of "Render to Separate Window" and "Start Fullscreen" already works for you?

@jasaaved
Copy link
Copy Markdown
Author

Just to confirm, the combination of "Render to Separate Window" and "Start Fullscreen" already works for you?

Yes.

@TheLastRar
Copy link
Copy Markdown
Contributor

Just to confirm, the combination of "Render to Separate Window" and "Start Fullscreen" already works for you?

Yes.

Interesting...

Removed a new line.
@TheLastRar
Copy link
Copy Markdown
Contributor

TheLastRar commented Apr 13, 2026

Just to confirm, the combination of "Render to Separate Window" and "Start Fullscreen" already works for you?

Yes.

Interesting...

Digging further, it may be due to us not setting a window size (either with setGeometry or resize).
If so, then I'm not sure why it was working for me before, maybe I was getting lucky with the uninitiated size?

Are you able to see if setting the window size (i,e. with setGeometry so we can set position at the same time) fixes the issue instead of create()?

@jasaaved
Copy link
Copy Markdown
Author

jasaaved commented Apr 13, 2026

Are you able to see if setting the window size (i,e. with setGeometry so we can set position at the same time) fixes the issue instead of create()?

I'll try this out once I'm back on my pc later tonight.

Also, is screen() supposed to be called that way? Shouldn't it be m_display_surface->screen()? That could be the fix, but I can't test it right now.

@TheLastRar
Copy link
Copy Markdown
Contributor

TheLastRar commented Apr 13, 2026

Are you able to see if setting the window size (i,e. with setGeometry so we can set position at the same time) fixes the issue instead of create()?

I'll try this out once I'm back on my pc later tonight.

Also, is screen() supposed to be called that way? Shouldn't it be m_display_surface->screen()? That could be the fix, but I can't test it right now.

m_display_surface hasn't been positioned yet (or create()ed), so I'm using the screen that the main window is on
You can check if it's correct by adding a Console.WriteLn(screen()->name().toStdString()) (or something to that) and checking the console logs

@jasaaved
Copy link
Copy Markdown
Author

Are you able to see if setting the window size (i,e. with setGeometry so we can set position at the same time) fixes the issue instead of create()?

I removed create() and replace setPosition() with setGeometry and that has seemed to fixed it. I will be pushing it soon. Testing it a bit more to make sure it didn't break anything. Render to a separate window still works just like before.

I need to update the title of this PR though. It wasn't just an exclusive fullscreen issue. It was happening with borderless fullscreen as well, I just didn't test it. The main issue was rendering to the main window, not exclusive/borderless.

An explicit call to create() seems no longer necessary if setGeometry() is used. This replaces the setPosition() that was originally here.
@jasaaved jasaaved changed the title Qt: Fix Exclusive Fullscreen Not Launching on the Correct Display When Rendering to Main Qt: Fix Games Not Launching on the Correct Display When Rendering to Main Apr 14, 2026
@jasaaved
Copy link
Copy Markdown
Author

setGeometry has been pushed. While testing, I did discover another bug. It's not caused by setGeometry because it happens on the nightly build as well.

Make sure rendering to main is on and start fullscreen is off, fullscreen after the game launches. A new window is made, so there are two windows. One for main and the other for the game even though it is supposed to render to main. I don't think that is intentional. That fix is probably for another PR though.

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.

3 participants