(X11) Do not keep appending to suspend screensaver if not available

This commit is contained in:
twinaphex 2016-03-21 19:12:16 +01:00
parent b20989d31d
commit ca63357b54

View File

@ -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,