aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-29 20:37:11 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-29 20:37:11 +0100
commita119220961d3df6d8f5f96d3a646adedb5d99554 (patch)
treeb075197c3d534e66ea9c74cc1c0bec3ce508f756 /src/main.cpp
parent9dd20e29165a44993ec64b7074b52d134f4dfcd9 (diff)
Add buttons to exit program and to go back to old ui for flatpak
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9c2802b..41f732c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -283,8 +283,10 @@ int main(int argc, char **argv) {
// TODO: Add hotkeys in Overlay when using x11 global hotkeys. The hotkeys in Overlay should duplicate each key that is used for x11 global hotkeys.
+ std::string exit_reason;
mgl::Clock frame_delta_clock;
- while(running && mgl_is_connected_to_display_server()) {
+
+ while(running && mgl_is_connected_to_display_server() && !overlay->should_exit(exit_reason)) {
const double frame_delta_seconds = frame_delta_clock.restart();
gsr::set_frame_delta_seconds(frame_delta_seconds);
@@ -301,6 +303,12 @@ int main(int argc, char **argv) {
gsr::deinit_theme();
gsr::deinit_color_theme();
mgl_deinit();
+ global_hotkeys.reset();
+
+ if(exit_reason == "back-to-old-ui") {
+ const char *args[] = { "gpu-screen-recorder-gtk", nullptr };
+ execvp(args[0], (char* const*)args);
+ }
return 0;
}