Qt: Fix Games Not Launching on the Correct Display When Rendering to Main#14292
Qt: Fix Games Not Launching on the Correct Display When Rendering to Main#14292jasaaved wants to merge 3 commits intoPCSX2:masterfrom
Conversation
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.
|
Just to confirm, the combination of "Render to Separate Window" and "Start Fullscreen" already works for you? |
Yes. |
Interesting... |
Removed a new line.
Digging further, it may be due to us not setting a window size (either with setGeometry or resize). 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. |
|
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.
|
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. |
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
Did you use AI to help find, test, or implement this issue or feature?
No.