Own Linux title callback and trim Win32 key state

This commit is contained in:
2026-06-17 10:46:02 +02:00
parent 3941c54d90
commit 00f97c71b5
6 changed files with 23 additions and 20 deletions

View File

@@ -58,18 +58,6 @@ namespace {
void App::set_platform_services(pp::platform::PlatformServices* services) noexcept
{
platform_services_ = services;
#ifdef __LINUX__
if (services)
{
pp::platform::linux_desktop::set_fps_title_callback([](std::string title) {
pp::platform::legacy::set_legacy_glfw_window_title(title);
});
}
else
{
pp::platform::linux_desktop::set_fps_title_callback({});
}
#endif
}
pp::platform::PlatformServices* App::platform_services() const noexcept

View File

@@ -14,6 +14,11 @@ void destroy_window();
namespace pp::platform::windows {
struct RetainedState final
{
bool keys[256]{};
};
namespace {
[[nodiscard]] WacomTablet& active_wacom_tablet()
@@ -36,7 +41,8 @@ namespace {
[[nodiscard]] std::map<kKey, int>& retained_virtual_key_map()
{
return retained_state().vkey_map;
static std::map<kKey, int> vkey_map;
return vkey_map;
}
void synchronize_app_key_state_from_keyboard(App& app)

View File

@@ -1,19 +1,14 @@
#pragma once
#include <Windows.h>
#include <map>
#include "event.h"
#include "platform_windows/windows_vr_shell.h"
struct RetainedState
{
bool keys[256]{};
std::map<kKey, int> vkey_map;
};
namespace pp::platform::windows {
struct RetainedState;
void initialize_retained_input_state();
RetainedState& retained_state();
pp::platform::windows::VrShellState& retained_vr_shell_state() noexcept;