mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
graphics: respect Windows dark mode (#765)
Only affects the caption bar. Should work for: - [x] standalone configurator - [x] dx9 games, including multi-window games like gitadora - [x] Unity games
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "launcher/launcher.h"
|
||||
#include "misc/eamuse.h"
|
||||
#include "util/utils.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// overlay render bridge
|
||||
@@ -123,6 +124,10 @@ void try_create_overlay(IDXGISwapChain *swapchain) {
|
||||
return;
|
||||
}
|
||||
|
||||
// theme the native title bar; first present is the only reliable point for
|
||||
// windows whose swapchain bypasses our factory hooks (e.g. UnityPlayer.dll)
|
||||
set_window_dark_titlebar(desc.OutputWindow);
|
||||
|
||||
ID3D11Device *device = nullptr;
|
||||
if (FAILED(swapchain->GetDevice(IID_PPV_ARGS(&device))) || !device) {
|
||||
return;
|
||||
|
||||
@@ -585,6 +585,9 @@ static HWND WINAPI CreateWindowExA_hook(DWORD dwExStyle, LPCSTR lpClassName, LPC
|
||||
hWndParent, hMenu, hInstance, lpParam);
|
||||
GRAPHICS_WINDOWS.push_back(result);
|
||||
|
||||
// theme the native title bar (dark/light)
|
||||
set_window_dark_titlebar(result);
|
||||
|
||||
if (is_tdj_sub_window) {
|
||||
// TDJ windowed mode: remember the subscreen window handle for later
|
||||
TDJ_SUBSCREEN_WINDOW = result;
|
||||
@@ -706,6 +709,9 @@ static HWND WINAPI CreateWindowExW_hook(DWORD dwExStyle, LPCWSTR lpClassName, LP
|
||||
hWndParent, hMenu, hInstance, lpParam);
|
||||
GRAPHICS_WINDOWS.push_back(result);
|
||||
|
||||
// theme the native title bar (dark/light)
|
||||
set_window_dark_titlebar(result);
|
||||
|
||||
log_misc(
|
||||
"graphics",
|
||||
"CreateWindowExW returned {}, {}",
|
||||
|
||||
Reference in New Issue
Block a user