Those checks aren't needed.

This commit is contained in:
Alcaro 2016-09-16 00:44:52 +02:00
parent 8e758bf155
commit f6b7fc17f6

View File

@ -150,14 +150,14 @@ static void dbus_screensaver_uninhibit(void)
if (!dbus_connection)
return;
if (dbus_screensaver_cookie <= 0)
if (!dbus_screensaver_cookie)
return;
msg = dbus_message_new_method_call("org.freedesktop.ScreenSaver",
"/org/freedesktop/ScreenSaver",
"org.freedesktop.ScreenSaver",
"UnInhibit");
dbus_message_append_args (msg,
dbus_message_append_args(msg,
DBUS_TYPE_UINT32, &dbus_screensaver_cookie,
DBUS_TYPE_INVALID);
@ -173,16 +173,8 @@ static void dbus_screensaver_uninhibit(void)
void x11_suspend_screensaver_dbus(bool enable)
{
/* Disable requested and was not already suspended */
if (!enable && !dbus_screensaver_cookie == 0)
return;
/* Disable requesed and was suspended -> unsuspend */
if (!enable && dbus_screensaver_cookie > 0)
dbus_screensaver_uninhibit();
if (enable)
dbus_screensaver_inhibit();
if (enable) dbus_screensaver_inhibit();
if (!enable) dbus_screensaver_uninhibit();
}
#endif