diff --git a/include/frontend.hpp b/include/frontend.hpp index 884aa21..188a6ec 100755 --- a/include/frontend.hpp +++ b/include/frontend.hpp @@ -127,6 +127,7 @@ public: void display_call(bool is_main_thread); void display_thread(CaptureData* capture_data); void end(); + void after_thread_join(); void draw(double frame_time, VideoOutputData* out_buf); void print_notification(std::string text, TextKind kind = TEXT_KIND_NORMAL); diff --git a/source/WindowScreen.cpp b/source/WindowScreen.cpp index cfe2065..996f731 100755 --- a/source/WindowScreen.cpp +++ b/source/WindowScreen.cpp @@ -290,6 +290,8 @@ void WindowScreen::poll() { break; } + break; + default: break; } } @@ -324,8 +326,8 @@ void WindowScreen::display_thread(CaptureData* capture_data) { this->display_call(false); } } - if(this->m_win.isOpen()) - this->m_win.close(); + if(!this->main_thread_owns_window) + this->m_win.setActive(false); this->done_display = true; } @@ -335,6 +337,13 @@ void WindowScreen::end() { this->display_lock.unlock(); } +void WindowScreen::after_thread_join() { + if(this->m_win.isOpen()) { + this->m_win.setActive(true); + this->m_win.close(); + } +} + void WindowScreen::draw(double frame_time, VideoOutputData* out_buf) { if(!this->done_display) return; @@ -537,7 +546,7 @@ void WindowScreen::window_factory(bool is_main_thread) { } void WindowScreen::pre_texture_conversion_processing() { - //Place preprocessing effects here + //Place preprocessing window-specific effects here this->in_tex.update((uint8_t*)this->saved_buf, IN_VIDEO_WIDTH, IN_VIDEO_HEIGHT, 0, 0); } diff --git a/source/cc3dsfs.cpp b/source/cc3dsfs.cpp index 1e3fa8b..c3e3a8b 100755 --- a/source/cc3dsfs.cpp +++ b/source/cc3dsfs.cpp @@ -356,6 +356,10 @@ void mainVideoOutputCall(AudioData* audio_data, CaptureData* capture_data) { bot_thread.join(); joint_thread.join(); + top_screen.after_thread_join(); + bot_screen.after_thread_join(); + joint_screen.after_thread_join(); + if (!skip_io) { save(base_path, base_name, top_screen.m_info, bot_screen.m_info, joint_screen.m_info, display_data, audio_data, out_text_data); }