[gnome-desktop] idle-monitor: Guard against 0 msecs idle intervals
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] idle-monitor: Guard against 0 msecs idle intervals
- Date: Fri, 2 Mar 2018 18:05:13 +0000 (UTC)
commit 4d9040b097f544154ebdeeee1a90c374ff6aac41
Author: Bastien Nocera <hadess hadess net>
Date: Fri Mar 2 18:29:53 2018 +0100
idle-monitor: Guard against 0 msecs idle intervals
As mutter guards against 0 msec idle watches in
meta_idle_monitor_add_idle_watch()
https://bugzilla.gnome.org/show_bug.cgi?id=793999
libgnome-desktop/gnome-idle-monitor.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index b85c096..9dc9043 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -534,7 +534,8 @@ add_active_watch (GnomeIdleMonitor *monitor,
/**
* gnome_idle_monitor_add_idle_watch:
* @monitor: A #GnomeIdleMonitor
- * @interval_msec: The idletime interval, in milliseconds
+ * @interval_msec: The idletime interval, in milliseconds. It must be
+ * a strictly positive value (> 0).
* @callback: (allow-none): The callback to call when the user has
* accumulated @interval_msec milliseconds of idle time.
* @user_data: (allow-none): The user data to pass to the callback
@@ -563,6 +564,7 @@ gnome_idle_monitor_add_idle_watch (GnomeIdleMonitor *monitor,
GnomeIdleMonitorWatch *watch;
g_return_val_if_fail (GNOME_IS_IDLE_MONITOR (monitor), 0);
+ g_return_val_if_fail (interval_msec > 0, 0);
watch = make_watch (monitor,
interval_msec,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]