Skip to content

Commit

Permalink
shot in the dark
Browse files Browse the repository at this point in the history
  • Loading branch information
theyareonit committed Sep 15, 2024
1 parent 0988804 commit 98fa6fa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "includes.hpp"

#include <limits>
#include <algorithm>

#include <Geode/Geode.hpp>
#include <Geode/loader/SettingEvent.hpp>
Expand Down Expand Up @@ -502,7 +503,13 @@ HANDLE gdMutex;
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));

if (!CreateProcess(CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true).c_str(), NULL, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
std::string path = "\"" + CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true) + "\"";
std::replace(path.begin(), path.end(), '\\', '/');

std::unique_ptr<char[]> cmd(new char[path.size() + 1]);
strcpy(cmd.get(), path.c_str());

if (!CreateProcess(NULL, cmd.get(), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
log::error("Failed to launch Linux input program: {}", GetLastError());
CloseHandle(hMutex);
CloseHandle(gdMutex);
Expand Down

0 comments on commit 98fa6fa

Please sign in to comment.