gnome-settings-daemon r356 - in branches/randr-12: . plugins/xrandr



Author: federico
Date: Fri May 30 18:00:06 2008
New Revision: 356
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=356&view=rev

Log:
Create the xrandr status icon

Signed-off-by: Federico Mena Quintero <federico novell com>


Modified:
   branches/randr-12/ChangeLog
   branches/randr-12/plugins/xrandr/gsd-xrandr-manager.c

Modified: branches/randr-12/plugins/xrandr/gsd-xrandr-manager.c
==============================================================================
--- branches/randr-12/plugins/xrandr/gsd-xrandr-manager.c	(original)
+++ branches/randr-12/plugins/xrandr/gsd-xrandr-manager.c	Fri May 30 18:00:06 2008
@@ -57,12 +57,17 @@
 
 #define VIDEO_KEYSYM    "XF86Display"
 
+/* name of the icon files (gsd-xrandr.svg, etc.) */
+#define GSD_XRANDR_ICON_NAME "gsd-xrandr"
+
 struct GsdXrandrManagerPrivate
 {
         /* Key code of the fn-F7 video key (XF86Display) */
         guint keycode;
         RWScreen *rw_screen;
         gboolean running;
+
+        GtkStatusIcon *status_icon;
 };
 
 enum {
@@ -151,11 +156,25 @@
 static void
 status_icon_start (GsdXrandrManager *manager)
 {
+        struct GsdXrandrManagerPrivate *priv = manager->priv;
+
+        /* FIXME: We may want to make this icon optional (with a GConf key,
+         * toggled from a checkbox in gnome-display-properties.
+         *
+         * Or ideally, we should detect if we are on a tablet and only display
+         * the icon in that case.
+         */
+
+        priv->status_icon = gtk_status_icon_new_from_icon_name (GSD_XRANDR_ICON_NAME);
 }
 
 static void
 status_icon_stop (GsdXrandrManager *manager)
 {
+        struct GsdXrandrManagerPrivate *priv = manager->priv;
+
+        g_object_unref (priv->status_icon);
+        priv->status_icon = NULL;
 }
 
 gboolean



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