-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve window management code #53
Conversation
I also added an option to disable the screensaver while the game's window is focused. I -highly- recommend shipping this turned on by default, as the Steam forums are flooded with users complaining about their display entering power saving mode during long cutscenes. Worst of all, when the display is powered back on, the game gives them an "Operation Completed Successfully" error 🤣 |
That looks great, and works fantastically. Disabling the screensaver is a nice touch! |
I just got this in a longer scene without having a screensaver enabled. I went ahead and increased my display inactivity timer from 5min in Windows, which I'm assuming will solve it. Does this merge solve that issue or is it just the screensaver? EDIT: Just got the message again, this time because of alt+tabbing during a paused cutscene lol |
Excellent! Everything seems to work perfectly. |
DisableScreenSaver isn't working for me so I checked the ini and the log. The FFXVIFix.log shows: |
Typo on my part, should be fixed in the next build. f4ed0cd |
It should stop windows from putting the display to sleep, yes. |
Thanks, Lyall. I saw your fix and corrected it in my ini. It's working now. |
I have fixed numerous issues with the new window management functions:
The logic to find the game's main window never times out, and only searches for windows running on the game's main thread
ClipCursor (...) is hooked so that no other code can change the rectangle; simply setting or clearing the boundaries on window activation is inadequate to prevent the cursor from slipping out of the window.
The mouse boundaries have been shrunken so that the title bar and resize frames are always grabbable.
The mouse boundaries are ignored while the user is resizing or dragging the window.
The mouse boundaries automatically update if the window is programmatically moved (i.e. Windows+Shift+Left/Right) to a different monitor.
WM_SETFOCUS
andWM_KILLFOCUS
are used instead of window activation for all things window-focus related.When swallowing window activation in order to prevent the game from muting, pass-through to
DefWindowProc (...)
so that RawInput stops processing mouse input when another window is active.The initialization thread is created suspended so that it does not run to completion before you can even set its priority 😸