Skip to content
Permalink
Browse files
Merge pull request #9183 from jordan-woyak/ss-inhibit-fix
DolphinQt: Don't call UICommon::InhibitScreenSaver if already in desired state.
  • Loading branch information
JosJuice committed Oct 22, 2020
2 parents 89b01cd + e8bb88c commit 98b7814
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
@@ -1434,6 +1434,11 @@ void MainWindow::UpdateScreenSaverInhibition()
const bool inhibit =
Config::Get(Config::MAIN_DISABLE_SCREENSAVER) && (Core::GetState() == Core::State::Running);

if (inhibit == m_is_screensaver_inhibited)
return;

m_is_screensaver_inhibited = inhibit;

#if defined(HAVE_XRANDR) && HAVE_XRANDR
if (GetWindowSystemType() == WindowSystemType::X11)
UICommon::InhibitScreenSaver(winId(), inhibit);
@@ -204,6 +204,7 @@ class MainWindow final : public QMainWindow
bool m_stop_requested = false;
bool m_exit_requested = false;
bool m_fullscreen_requested = false;
bool m_is_screensaver_inhibited = false;
int m_state_slot = 1;
std::unique_ptr<BootParameters> m_pending_boot;

0 comments on commit 98b7814

Please sign in to comment.