Add an Apply button to the Web UI when running as a Win32 Service (#700)

This commit is contained in:
Cameron Gutman
2023-01-05 13:26:54 -06:00
committed by GitHub
parent 5980e520b9
commit 65574a02d4
7 changed files with 153 additions and 10 deletions

View File

@@ -318,6 +318,9 @@ void adjust_thread_priority(thread_priority_e priority);
void streaming_will_start();
void streaming_will_stop();
bool restart_supported();
bool restart();
input_t input();
void move_mouse(input_t &input, int deltaX, int deltaY);
void abs_mouse(input_t &input, const touch_port_t &touch_port, float x, float y);

View File

@@ -165,6 +165,16 @@ void streaming_will_stop() {
// Nothing to do
}
bool restart_supported() {
// Restart not supported yet
return false;
}
bool restart() {
// Restart not supported yet
return false;
}
namespace source {
enum source_e : std::size_t {
#ifdef SUNSHINE_BUILD_CUDA

View File

@@ -143,6 +143,16 @@ void streaming_will_stop() {
// Nothing to do
}
bool restart_supported() {
// Restart not supported yet
return false;
}
bool restart() {
// Restart not supported yet
return false;
}
} // namespace platf
namespace dyn {

View File

@@ -1,3 +1,4 @@
#include <csignal>
#include <filesystem>
#include <iomanip>
#include <sstream>
@@ -522,4 +523,16 @@ void streaming_will_stop() {
DwmEnableMMCSS(false);
}
bool restart_supported() {
// Restart is supported if we're running from the service
return (GetConsoleWindow() == NULL);
}
bool restart() {
// Raise SIGINT to trigger the graceful exit logic. The service will
// restart us in a few seconds.
std::raise(SIGINT);
return true;
}
} // namespace platf