From 44f8b582910fb440b732e07e0a9e03a5ead3e8d8 Mon Sep 17 00:00:00 2001 From: shadow <81448108+shdwmtr@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:31:45 -0400 Subject: [PATCH] chore: Windows fixes --- .vscode/settings.json | 3 ++- assets/core/util/theme_installer.py | 2 +- preload/main.cc | 4 ++-- src/core/co_spawn.cc | 1 - src/sys/env.cc | 2 +- src/sys/log.cc | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4635b9f4..6cbba590 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -87,6 +87,7 @@ "typeindex": "cpp", "stdio.h": "c", "cli.hpp": "c", - "unistd.h": "c" + "unistd.h": "c", + "strstream": "cpp" } } \ No newline at end of file diff --git a/assets/core/util/theme_installer.py b/assets/core/util/theme_installer.py index 2fbd3af3..d7cf2d38 100644 --- a/assets/core/util/theme_installer.py +++ b/assets/core/util/theme_installer.py @@ -132,7 +132,7 @@ def __init__(self, host="localhost", port=9123): def verify_origin(self, origin): return origin == "https://steambrew.app" - async def handler(self, websocket: websockets.ServerConnection): + async def handler(self, websocket): if not self.verify_origin(websocket.request.headers.get("Origin")): logger.error("Invalid origin") diff --git a/preload/main.cc b/preload/main.cc index 378e8d29..8376102c 100644 --- a/preload/main.cc +++ b/preload/main.cc @@ -218,8 +218,8 @@ void AllocateDevConsole() { std::unique_ptr startupParams = std::make_unique(); - /** Check if developer mode is activated */ - if (!startupParams->HasArgument("-dev")) + /** Check if CTRL+SHIFT is being held, Check if developer mode is activated */ + if (!((GetAsyncKeyState(VK_MENU) & 0x8000) && (GetAsyncKeyState('M') & 0x8000)) && !startupParams->HasArgument("-dev")) { return; } diff --git a/src/core/co_spawn.cc b/src/core/co_spawn.cc index 328b4147..67a2b010 100644 --- a/src/core/co_spawn.cc +++ b/src/core/co_spawn.cc @@ -306,7 +306,6 @@ bool PythonManager::CreatePythonInstance(SettingsStore::PluginTypeSchema& plugin // Sit on the mutex until daddy says it's time to go std::unique_lock lock(interpMutexStatePtr->mtx); interpMutexStatePtr->cv.wait(lock, [interpMutexStatePtr] { - std::cout << "Waiting for plugin to shut down..." << std::endl; return interpMutexStatePtr->flag.load(); }); diff --git a/src/sys/env.cc b/src/sys/env.cc index 0958ab9c..ed21101f 100644 --- a/src/sys/env.cc +++ b/src/sys/env.cc @@ -138,8 +138,8 @@ const void SetupEnvironmentVariables() if (access(value.c_str(), R_OK) != 0) { std::cout << fmt::format("{}{}{}{}{}", RED, "Error: ", RESET, fmt::format("Permission denied to access '{}'.", value), "\n"); } - #endif std::cout << fmt::format("{}={}", key, value) << std::endl; + #endif SetEnv(key, value); } } \ No newline at end of file diff --git a/src/sys/log.cc b/src/sys/log.cc index 92a73b1c..98dfe2b5 100644 --- a/src/sys/log.cc +++ b/src/sys/log.cc @@ -78,7 +78,7 @@ OutputLogger::OutputLogger() { std::unique_ptr startupParams = std::make_unique(); - m_bIsConsoleEnabled = startupParams->HasArgument("-dev"); + m_bIsConsoleEnabled = ((GetAsyncKeyState(VK_MENU) & 0x8000) && (GetAsyncKeyState('M') & 0x8000)) || startupParams->HasArgument("-dev"); m_bIsVersbose = startupParams->HasArgument("-verbose"); } #elif __linux__