From ca63357b5442db66547aa6f5ed3d592587c13605 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 21 Mar 2016 19:12:16 +0100 Subject: [PATCH] (X11) Do not keep appending to suspend screensaver if not available --- gfx/common/x11_common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 0180959a07..5a957e8d5b 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -145,6 +145,10 @@ void x11_suspend_screensaver(Window wnd) { int ret; char cmd[64] = {0}; + static bool screensaver_na = false; + + if (screensaver_na) + return; RARCH_LOG("Suspending screensaver (X11).\n"); @@ -152,9 +156,15 @@ void x11_suspend_screensaver(Window wnd) ret = system(cmd); if (ret == -1) + { + screensaver_na = true; RARCH_WARN("Failed to launch xdg-screensaver.\n"); + } else if (WEXITSTATUS(ret)) + { + screensaver_na = true; RARCH_WARN("Could not suspend screen saver.\n"); + } } static bool get_video_mode(Display *dpy, unsigned width, unsigned height,