aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-31 01:50:06 +0200
committerdec05eba <dec05eba@protonmail.com>2022-03-31 01:50:06 +0200
commite49d30048f46a51c766c347e52e9ce24522b6861 (patch)
tree7a034b225e1b4f3a6126b893ecb53805d284930d /src
parent7228d3664764a55018d93b216b917668cfc25a32 (diff)
Close screenrecorder when target window is closed
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 858755b..21927a3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1405,6 +1405,12 @@ int main(int argc, char **argv) {
if (frame_time_overflow >= 0.0) {
frame_timer_start = time_now - frame_time_overflow;
+ if(dpy && src_window_id) {
+ XWindowAttributes attr;
+ if(!XGetWindowAttributes(dpy, src_window_id, &attr))
+ running = 0;
+ }
+
bool frame_captured = true;
if(redraw) {
redraw = false;