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



commit 09398901b3d3ac6edcdd7fd76a2ee7dccb0c7b6d
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 3a942ad..123983f 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);
 }
@@ -481,8 +481,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;
@@ -521,8 +521,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]