aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-03-31 01:53:39 +0200
committerdec05eba <dec05eba@protonmail.com>2022-03-31 01:53:39 +0200
commitc43fa5e4eeee78c0990a6343b6c6246422b3ab9c (patch)
tree8ef2efb48c5bbd3b0aa4ad26eb0b18e2e0dac24e /src
parente49d30048f46a51c766c347e52e9ce24522b6861 (diff)
Better detection of window destroyed
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 21927a3..280e3f3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1314,6 +1314,10 @@ int main(int argc, char **argv) {
redraw = true;
if(src_window_id) {
+ if (XCheckTypedWindowEvent(dpy, src_window_id, DestroyNotify, &e)) {
+ running = 0;
+ }
+
if (XCheckTypedWindowEvent(dpy, src_window_id, VisibilityNotify, &e)) {
window_resize_timer = glfwGetTime();
window_resized = true;
@@ -1405,12 +1409,6 @@ 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;