diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 11:19:08 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-28 11:19:08 +0200 |
| commit | d413388761c85c1bd153a4bbf8b6f96189cd416a (patch) | |
| tree | 2d073c24292f5ecd94c0b441864bf8b1306fc4e5 /src/debug | |
| parent | 4203a61b69f5ee31d142920b5ef0b652d7bbb143 (diff) | |
Multiple improvements to the shutdown procedure
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 6 | ||||
| -rw-r--r-- | src/debug/HyprCtl.hpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 6b89b3c6..2cf2781e 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -759,7 +759,7 @@ std::string getRequestFromThread(std::string rq) { } void HyprCtl::startHyprCtlSocket() { - std::thread([&]() { + tThread = std::thread([&]() { const auto SOCKET = socket(AF_UNIX, SOCK_STREAM, 0); if (SOCKET < 0) { @@ -806,5 +806,7 @@ void HyprCtl::startHyprCtlSocket() { } close(SOCKET); - }).detach(); + }); + + tThread.detach(); } diff --git a/src/debug/HyprCtl.hpp b/src/debug/HyprCtl.hpp index 60559e9f..b717f50f 100644 --- a/src/debug/HyprCtl.hpp +++ b/src/debug/HyprCtl.hpp @@ -15,6 +15,8 @@ namespace HyprCtl { inline std::ifstream requestStream; + inline std::thread tThread; + enum eHyprCtlOutputFormat { FORMAT_NORMAL = 0, FORMAT_JSON |
