Split Win32 main window session state

This commit is contained in:
2026-06-17 11:17:02 +02:00
parent 81a998436d
commit 949dbf778a
11 changed files with 92 additions and 53 deletions

View File

@@ -0,0 +1,47 @@
#include "pch.h"
#include "platform_windows/windows_main_window_session.h"
namespace pp::platform::windows {
namespace {
struct RetainedMainWindowSessionState final {
HWND handle{};
wchar_t title[512]{};
bool sandboxed = false;
};
[[nodiscard]] RetainedMainWindowSessionState& retained_main_window_session_state() noexcept
{
static RetainedMainWindowSessionState state;
return state;
}
}
HWND& retained_main_window_handle_ref() noexcept
{
return retained_main_window_session_state().handle;
}
wchar_t* retained_main_window_title_buffer() noexcept
{
return retained_main_window_session_state().title;
}
const wchar_t* retained_main_window_title() noexcept
{
return retained_main_window_session_state().title;
}
bool retained_main_window_sandboxed() noexcept
{
return retained_main_window_session_state().sandboxed;
}
void set_retained_main_window_sandboxed(bool sandboxed) noexcept
{
retained_main_window_session_state().sandboxed = sandboxed;
}
}