aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-02-22 13:20:36 +0100
committerdec05eba <dec05eba@protonmail.com>2025-02-22 13:20:36 +0100
commitce4a8574f8c8f16beb0700d4d4e747c2cd848583 (patch)
treea4b6f51effbecdee76d06a7b8ddeaf1c4b6eb802 /src
parent42b1f8eacbb09887dd24565c353e44d6f6335b7b (diff)
Make it possible to stop screenshot with sigint
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 10dc5a6..42cf4d2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2539,10 +2539,12 @@ static void capture_image_to_file(const char *filepath, std::string &window_str,
bool should_stop_error = false;
egl->glClear(0);
- while(true) {
+ while(running) {
should_stop_error = false;
- if(gsr_capture_should_stop(capture, &should_stop_error))
+ if(gsr_capture_should_stop(capture, &should_stop_error)) {
+ running = 0;
break;
+ }
// It can fail, for example when capturing portal and the target is a monitor that hasn't been updated.
// Desktop portal wont refresh the image until there is an update.