Closed surrealwaffle closed 4 years ago
I gave this a test and it works great. Seems to work as expected on Windows native, Windows with dgVoodoo2, Wine Open GL, Wine DXVK, and Wine DXVK+dgVoodoo2. I'm not sure we should have it as an ini option though, since it seems to have no down sides and would only cause issues when disabled. I'd consider it a bugfix.
By default, the fix is enabled when background_playback
is on. If the fix works well, users will never have to touch the option for the fix. That said, I can revert the commit if the ini option is unwanted.
Well, personally I think having an option that can potentially make ALT-F4 the only possible way to exit the game is not ideal. We could always add the option back later if a use case is found that needs it.
Alright. Option removed.
Seeing as this works as intended, I'm going to go ahead and approve this.
This PR partially addresses #24, specifically subissue 2 when
background_playback
is active and Halo is fullscreen, alt-tabbing causes Halo to be brought to the foreground. The issue should be left open, as the game will still crash upon tabbing back in through a game change.Summary of the PR Features
tabbed_video_device_reacquisition
) that can be used to disable the hook.Because the problem seems to be a matter of system implementation (see below), I thought it prudent to provide an option that disables this fix.
Summary of the Cause
Halo's rendering subsystem sets a flag to indicate that the device was lost, as detected by the return value of
device->Present()
. On the next frame, if this flag was set, Halo will attempt to reacquire the device (via some cleanup anddevice->Reset()
) before callingdevice->BeginScene()
. If if fails to reacquire the device, then that frame is skipped with no call todevice->BeginScene
.With
background_playback
active, Halo will be more eager to render frames, resulting in a call todevice->Reset()
while the user is tabbed out and Halo is fullscreen. An effect of that invocation on native D3D9 is that the window appears in the foreground but does not accept input.Edit: Change of wording to stop Github from closing the issue if the PR is accepted.