[Goodies-commits] r7101 - in gigolo/trunk: . src

Enrico Troeger enrico at xfce.org
Thu Apr 2 23:45:11 CEST 2009


Author: enrico
Date: 2009-04-02 21:45:11 +0000 (Thu, 02 Apr 2009)
New Revision: 7101

Modified:
   gigolo/trunk/ChangeLog
   gigolo/trunk/src/window.c
Log:
Present the main window when the status icon is removed.

Modified: gigolo/trunk/ChangeLog
===================================================================
--- gigolo/trunk/ChangeLog	2009-04-02 17:05:35 UTC (rev 7100)
+++ gigolo/trunk/ChangeLog	2009-04-02 21:45:11 UTC (rev 7101)
@@ -1,6 +1,12 @@
 2009-04-01  Enrico Tröger  <enrico(at)xfce(dot)org>
 
  * src/window.c:
+   Present the main window when the status icon is removed.
+
+
+2009-04-02  Enrico Tröger  <enrico(at)xfce(dot)org>
+
+ * src/window.c:
    Set the 'is-important' flag for actions 'Bookmark' and
    'EditBookmarks'.
 

Modified: gigolo/trunk/src/window.c
===================================================================
--- gigolo/trunk/src/window.c	2009-04-02 17:05:35 UTC (rev 7100)
+++ gigolo/trunk/src/window.c	2009-04-02 21:45:11 UTC (rev 7101)
@@ -1036,6 +1036,32 @@
 }
 
 
+static void gigolo_window_systray_notify_cb(GtkStatusIcon *sicon, GParamSpec *pspec, GtkWindow *window)
+{
+	const gchar *name;
+	GValue *value;
+
+	/* nothing to do if the main window is visible */
+	if (gtk_window_is_active(window))
+		return;
+
+	name = g_intern_string(pspec->name);
+	value = g_new0(GValue, 1);
+	g_value_init(value, pspec->value_type);
+
+	if (name == g_intern_string("embedded"))
+	{
+		g_object_get_property(G_OBJECT(sicon), name, value);
+		/* if the icon is not embedded anymore, we display the main window otherwise
+		 * it will be lost */
+		if (! g_value_get_boolean(value))
+		{
+			gtk_window_present(window);
+		}
+	}
+}
+
+
 static void gigolo_window_settings_notify_cb(GigoloSettings *settings, GParamSpec *pspec, GigoloWindow *window)
 {
 	const gchar *name;
@@ -1441,6 +1467,7 @@
 	gigolo_status_icon_set_tooltip_text(priv->systray_icon, _("Gigolo"));
 	g_signal_connect(priv->systray_icon, "activate", G_CALLBACK(systray_icon_activate_cb), window);
 	g_signal_connect(priv->systray_icon, "popup-menu", G_CALLBACK(systray_icon_popup_menu_cb), window);
+	g_signal_connect(priv->systray_icon, "notify", G_CALLBACK(gigolo_window_systray_notify_cb), window);
 
 	g_object_unref(ui_manager);
 }




More information about the Goodies-commits mailing list