diff options
author | dec05eba <dec05eba@protonmail.com> | 2022-07-17 23:46:47 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2022-07-17 23:46:47 +0200 |
commit | db4944cd08381345df322d2f0b62383f899674b7 (patch) | |
tree | 3d28929975e3cc841e67efceadf892a03fdd4f18 /src/main.cpp | |
parent | 228a68aaac7389f22ab144a0bdadb773cab28409 (diff) |
Check if visibility really change on event change
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index d631aa3..6afbc82 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1245,6 +1245,7 @@ int main(int argc, char **argv) { double record_start_time = glfwGetTime(); std::deque<AVPacket> frame_data_queue; bool frames_erased = false; + int prev_visibility_state = VisibilityFullyObscured; SoundDevice sound_device; uint8_t *audio_frame_buf; @@ -1319,8 +1320,11 @@ int main(int argc, char **argv) { } if (XCheckTypedWindowEvent(dpy, src_window_id, VisibilityNotify, &e)) { - window_resize_timer = glfwGetTime(); - window_resized = true; + if((prev_visibility_state == VisibilityFullyObscured && e.xvisibility.state != VisibilityFullyObscured) || (e.xvisibility.state == prev_visibility_state)) { + window_resize_timer = glfwGetTime(); + window_resized = true; + } + prev_visibility_state = e.xvisibility.state; } if (XCheckTypedWindowEvent(dpy, src_window_id, ConfigureNotify, &e) && e.xconfigure.window == src_window_id) { |