Merge remote-tracking branch 'origin/master'

This commit is contained in:
Yukino Song
2024-08-07 22:56:18 +08:00
78 changed files with 5169 additions and 5772 deletions

View File

@@ -71,6 +71,15 @@ SessionMonitorWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
}
WINAPI BOOL
ConsoleCtrlHandler(DWORD type) {
if (type == CTRL_CLOSE_EVENT) {
BOOST_LOG(info) << "Console closed handler called";
lifetime::exit_sunshine(0, false);
}
return FALSE;
}
#endif
int
@@ -244,6 +253,11 @@ main(int argc, char *argv[]) {
shutdown_event->raise(true);
});
#ifdef _WIN32
// Terminate gracefully on Windows when console window is closed
SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE);
#endif
proc::refresh(config::stream.file_apps);
// If any of the following fail, we log an error and continue event though sunshine will not function correctly.

View File

@@ -569,6 +569,8 @@ namespace platf::dxgi {
// Ensure offset starts at 0x0
offset_x -= GetSystemMetrics(SM_XVIRTUALSCREEN);
offset_y -= GetSystemMetrics(SM_YVIRTUALSCREEN);
break;
}
}