Skip to content

Commit

Permalink
Fixed ActivateAtStart option not working correctly when used with SK'…
Browse files Browse the repository at this point in the history
…s "Continue Rendering" window management feature
  • Loading branch information
Kaldaien committed Aug 4, 2023
1 parent 03ba0e7 commit a5b186d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
23.8.3.4
23.8.3.5
========
+ Fixed ActivateAtStart option not working correctly when used with SK's
"Continue Rendering" window management feature

23.8.3.4
========
+ Fixed potential black screen in some multi-window applications such as VLC

Expand Down
4 changes: 2 additions & 2 deletions include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#define SK_YEAR 23
#define SK_MONTH 8
#define SK_DATE 3
#define SK_REV_N 4
#define SK_REV 4
#define SK_REV_N 5
#define SK_REV 5

#ifndef _A2
#define _A2(a) #a
Expand Down
12 changes: 10 additions & 2 deletions src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,8 @@ SK_StartupCore (const wchar_t* backend, void* callback)
{
try
{
AllowSetForegroundWindow (GetCurrentProcessId ());

if ( SK_GetProcAddress ( L"NtDll",
"wine_get_version" ) != nullptr )
{
Expand Down Expand Up @@ -2868,11 +2870,17 @@ SK_FrameCallback ( SK_RenderBackend& rb,
{
if (game_window.hWnd != 0)
{
if (config.window.activate_at_start)
if (config.window.activate_at_start || config.window.background_render)
{
// Activate the game window one time
// (workaround wonkiness from splash screens, etc.)
SK_RunOnce (SetForegroundWindow (game_window.hWnd));
SK_RunOnce (
{
game_window.CallProc (game_window.hWnd, WM_ACTIVATEAPP, TRUE, 0);
game_window.CallProc (game_window.hWnd, WM_ACTIVATE, MAKEWPARAM (WA_ACTIVE, 0), 0);
game_window.CallProc (game_window.hWnd, WM_SETFOCUS, 0, 0);
SetForegroundWindow ( game_window.hWnd );
});
}

// If user wants position / style overrides, kick them off on the first
Expand Down

0 comments on commit a5b186d

Please sign in to comment.