[gnome-desktop/gnome-3-8] idle-monitor: Store the monitor in the private watch struct



commit 34a0e5b431e556e1f02dd880ecedb0309531a2ca
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 25 13:47:17 2013 -0400

    idle-monitor: Store the monitor in the private watch struct
    
    Since we'll need to access more things than just the Display
    on it, let's clean up the code for the access right now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696522

 libgnome-desktop/gnome-idle-monitor.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c
index 4882bc5..34b3623 100644
--- a/libgnome-desktop/gnome-idle-monitor.c
+++ b/libgnome-desktop/gnome-idle-monitor.c
@@ -53,7 +53,7 @@ struct _GnomeIdleMonitorPrivate
 
 typedef struct
 {
-       Display                  *display;
+       GnomeIdleMonitor         *monitor;
        guint                     id;
        GnomeIdleMonitorWatchFunc callback;
        gpointer                  user_data;
@@ -255,7 +255,7 @@ idle_monitor_watch_free (GnomeIdleMonitorWatch *watch)
        }
 
        if (watch->id != USER_ACTIVE_WATCH_ID) {
-               XSyncDestroyAlarm (watch->display, watch->xalarm);
+               XSyncDestroyAlarm (watch->monitor->priv->display, watch->xalarm);
        }
        g_slice_free (GnomeIdleMonitorWatch, watch);
 }
@@ -479,8 +479,8 @@ gnome_idle_monitor_add_idle_watch (GnomeIdleMonitor        *monitor,
        g_return_val_if_fail (GNOME_IS_IDLE_MONITOR (monitor), 0);
 
        watch = g_slice_new0 (GnomeIdleMonitorWatch);
+       watch->monitor = monitor;
        watch->id = get_next_watch_serial ();
-       watch->display = monitor->priv->display;
        watch->callback = callback;
        watch->user_data = user_data;
        watch->notify = notify;
@@ -519,8 +519,8 @@ gnome_idle_monitor_add_user_active_watch (GnomeIdleMonitor          *monitor,
        g_return_val_if_fail (GNOME_IS_IDLE_MONITOR (monitor), 0);
 
        watch = g_slice_new0 (GnomeIdleMonitorWatch);
+       watch->monitor = monitor;
        watch->id = USER_ACTIVE_WATCH_ID;
-       watch->display = monitor->priv->display;
        watch->callback = callback;
        watch->user_data = user_data;
        watch->notify = notify;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]