Check if visibility really change on event change

This commit is contained in:
dec05eba 2022-07-17 23:46:47 +02:00
parent 228a68aaac
commit db4944cd08

View File

@ -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,9 +1320,12 @@ int main(int argc, char **argv) {
}
if (XCheckTypedWindowEvent(dpy, src_window_id, VisibilityNotify, &e)) {
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) {
// Window resize