diff --git a/include/frontend.hpp b/include/frontend.hpp index c99e2a9..92bc2f4 100755 --- a/include/frontend.hpp +++ b/include/frontend.hpp @@ -131,9 +131,6 @@ private: std::chrono::time_point last_draw_time; FPSArray poll_fps; std::chrono::time_point last_poll_time; - bool triggered_poweroff; - std::chrono::time_point last_poweroff_time; - const float poweroff_timeout = 30.0; sf::Texture in_tex; diff --git a/source/WindowScreen.cpp b/source/WindowScreen.cpp index c00dbbe..dca4ec1 100755 --- a/source/WindowScreen.cpp +++ b/source/WindowScreen.cpp @@ -27,7 +27,6 @@ WindowScreen::WindowScreen(ScreenType stype, CaptureStatus* capture_status, Disp FPSArrayInit(&this->in_fps); FPSArrayInit(&this->draw_fps); FPSArrayInit(&this->poll_fps); - this->triggered_poweroff = false; this->in_tex.create(IN_VIDEO_WIDTH, IN_VIDEO_HEIGHT); this->m_in_rect_top.setTexture(&this->in_tex); this->m_in_rect_bot.setTexture(&this->in_tex); @@ -211,8 +210,6 @@ void WindowScreen::update_connection() { } void WindowScreen::print_notification(std::string text, TextKind kind) { - if(this->triggered_poweroff) - return; this->notification->setText(text); this->notification->setRectangleKind(kind); this->notification->startTimer(true); diff --git a/source/WindowScreen_Menu.cpp b/source/WindowScreen_Menu.cpp index 08a9595..9d4d868 100755 --- a/source/WindowScreen_Menu.cpp +++ b/source/WindowScreen_Menu.cpp @@ -800,20 +800,11 @@ void WindowScreen::poll() { if(done) break; SFEvent event_data = events_queue.front(); - if(this->triggered_poweroff) { - // Stop accepting inputs... Not needed, since we're technically powering down... - auto curr_time = std::chrono::high_resolution_clock::now(); - const std::chrono::duration diff = curr_time - this->last_poweroff_time; - if(diff.count() < this->poweroff_timeout) - break; - this->triggered_poweroff = false; - } + events_queue.pop(); if((event_data.type == sf::Event::KeyPressed) && event_data.poweroff_cmd) { - this->m_prepare_save = STARTUP_FILE_INDEX; - this->print_notification("Saving and shutting\ndown...Please wait"); - this->triggered_poweroff = true; - this->last_poweroff_time = std::chrono::high_resolution_clock::now(); - break; + this->m_prepare_quit = true; + done = true; + continue; } if(this->query_reset_request()) { this->reset_held_times(); @@ -821,7 +812,6 @@ void WindowScreen::poll() { done = true; continue; } - events_queue.pop(); if(this->common_poll(event_data)) { if(this->close_capture()) done = true; diff --git a/source/frontend.cpp b/source/frontend.cpp index 743bfa9..64940ae 100755 --- a/source/frontend.cpp +++ b/source/frontend.cpp @@ -183,7 +183,7 @@ void reset_screen_info(ScreenInfo &info) { info.bot_rotation = 0; info.show_mouse = true; info.v_sync_enabled = false; - info.async = false; + info.async = true; info.top_scaling = -1; info.bot_scaling = -1; info.bfi = false;