summaryrefslogtreecommitdiff
path: root/src/yuzu/main.h
diff options
context:
space:
mode:
authorsnek <me@gus.host>2022-07-27 12:51:26 -0700
committerGitHub <noreply@github.com>2022-07-27 15:51:26 -0400
commit9479940a1fc7a399875d07496e036ce714b51207 (patch)
tree8ed1f3a10474c26f9d1809b7d546b54408f530b8 /src/yuzu/main.h
parent1779795d817f575ad48469d782b671ae7104bd19 (diff)
Merge pull request #8592 from devsnek/sig-handlers
exit gracefully on sigint/sigterm
Diffstat (limited to 'src/yuzu/main.h')
-rw-r--r--src/yuzu/main.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index de0d10974..509bb91df 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -163,6 +163,8 @@ signals:
void WebBrowserExtractOfflineRomFS();
void WebBrowserClosed(Service::AM::Applets::WebExitReason exit_reason, std::string last_url);
+ void SigInterrupt();
+
public slots:
void OnLoadComplete();
void OnExecuteProgram(std::size_t program_index);
@@ -251,6 +253,12 @@ private:
void RequestGameResume();
void closeEvent(QCloseEvent* event) override;
+#ifdef __linux__
+ void SetupSigInterrupts();
+ static void HandleSigInterrupt(int);
+ void OnSigInterruptNotifierActivated();
+#endif
+
private slots:
void OnStartGame();
void OnRestartGame();
@@ -419,6 +427,9 @@ private:
bool is_tas_recording_dialog_active{};
#ifdef __linux__
+ QSocketNotifier* sig_interrupt_notifier;
+ static std::array<int, 3> sig_interrupt_fds;
+
QDBusObjectPath wake_lock{};
#endif