diff -uNr vino-2.17.2/server/vino-prefs.c vino-2.17.2-wendell/server/vino-prefs.c
--- vino-2.17.2/server/vino-prefs.c	2006-10-13 05:48:29.000000000 -0300
+++ vino-2.17.2-wendell/server/vino-prefs.c	2006-11-15 21:11:28.000000000 -0300
@@ -38,23 +38,24 @@
 #define VINO_PREFS_REQUIRE_ENCRYPTION     VINO_PREFS_DIR "/require_encryption"
 #define VINO_PREFS_AUTHENTICATION_METHODS VINO_PREFS_DIR "/authentication_methods"
 #define VINO_PREFS_VNC_PASSWORD           VINO_PREFS_DIR "/vnc_password"
+#define VINO_PREFS_ALWAYS_SHOW_TRAY_ICON  VINO_PREFS_DIR "/always_show_tray_icon"
 
-#define VINO_N_LISTENERS 9
+#define VINO_N_LISTENERS 10
 
 static GConfClient *vino_client  = NULL;
 static GSList      *vino_servers = NULL;
 static guint        vino_listeners [VINO_N_LISTENERS] = { 0, };
 
-static gboolean        vino_enabled              = FALSE;
-static gboolean        vino_prompt_enabled       = FALSE;
-static gboolean        vino_view_only            = FALSE;
-static gboolean        vino_local_only           = FALSE;
-static gboolean        vino_require_encryption   = FALSE;
-static VinoAuthMethod  vino_auth_methods         = VINO_AUTH_VNC;
-static char           *vino_vnc_password         = NULL;
-static gboolean        vino_use_alternative_port = FALSE;
-static int             vino_alternative_port     = VINO_SERVER_DEFAULT_PORT;
-
+static gboolean        vino_enabled               = FALSE;
+static gboolean        vino_prompt_enabled        = FALSE;
+static gboolean        vino_view_only             = FALSE;
+static gboolean        vino_local_only            = FALSE;
+static gboolean        vino_require_encryption    = FALSE;
+static VinoAuthMethod  vino_auth_methods          = VINO_AUTH_VNC;
+static char           *vino_vnc_password          = NULL;
+static gboolean        vino_use_alternative_port  = FALSE;
+static int             vino_alternative_port      = VINO_SERVER_DEFAULT_PORT;
+static gboolean        vino_always_show_tray_icon = FALSE;
 
 static void
 vino_prefs_enabled_changed (GConfClient *client,
@@ -76,8 +77,10 @@
   
   dprintf (PREFS, "Access enabled changed: %s\n", vino_enabled ? "(true)" : "(false)");
 
-  for (l = vino_servers; l; l = l->next)
+  for (l = vino_servers; l; l = l->next) {
     vino_server_set_on_hold (l->data, !enabled);
+    vino_server_set_enabled (l->data, enabled);
+  }
 }
 
 static void
@@ -312,22 +315,48 @@
     vino_server_set_alternative_port (l->data, vino_alternative_port);
 }
 
+static void
+vino_prefs_always_show_tray_icon_changed (GConfClient *client,
+                                          guint        cnxn_id,
+                                          GConfEntry  *entry)
+{
+  gboolean  enabled;
+  GSList   *l;
+
+  if (!entry->value || entry->value->type != GCONF_VALUE_BOOL)
+    return;
+
+  enabled = gconf_value_get_bool (entry->value) != FALSE;
+
+  if (vino_always_show_tray_icon == enabled)
+    return;
+
+  vino_always_show_tray_icon = enabled;
+
+  dprintf (PREFS, "Always show tray icon key has changed: %s\n",
+           vino_always_show_tray_icon ? "(true)" : "(false)");
+
+  for (l = vino_servers; l; l = l->next)
+    vino_server_set_always_show_tray_icon (l->data, vino_always_show_tray_icon);
+}
+
 void
 vino_prefs_create_server (GdkScreen *screen)
 {
   VinoServer *server;
 
   server = g_object_new (VINO_TYPE_SERVER,
-			 "prompt-enabled",       vino_prompt_enabled,
-			 "view-only",            vino_view_only,
-			 "local-only",           vino_local_only,
-			 "use-alternative-port", vino_use_alternative_port,
-			 "alternative-port",     vino_alternative_port,
-			 "auth-methods",         vino_auth_methods,
-			 "require-encryption",   vino_require_encryption,
-			 "vnc-password",         vino_vnc_password,
-			 "on-hold",              !vino_enabled,
-			 "screen",               screen,
+			 "prompt-enabled",        vino_prompt_enabled,
+			 "view-only",             vino_view_only,
+			 "local-only",            vino_local_only,
+			 "use-alternative-port",  vino_use_alternative_port,
+			 "alternative-port",      vino_alternative_port,
+			 "auth-methods",          vino_auth_methods,
+			 "require-encryption",    vino_require_encryption,
+			 "vnc-password",          vino_vnc_password,
+			 "on-hold",               !vino_enabled,
+			 "screen",                screen,
+			 "always-show-tray-icon", vino_always_show_tray_icon,
 			 NULL);
 
   vino_servers = g_slist_prepend (vino_servers, server);
@@ -384,6 +413,11 @@
     vino_alternative_port = VINO_SERVER_DEFAULT_PORT;
   dprintf (PREFS, "Alternative port: %d\n", vino_alternative_port);
 
+  vino_always_show_tray_icon = gconf_client_get_bool (vino_client,
+					   VINO_PREFS_ALWAYS_SHOW_TRAY_ICON,
+					   NULL);
+  dprintf (PREFS, "Always show tray icon: %s\n", vino_always_show_tray_icon ? "(true)" : "(false)");
+
   vino_require_encryption = gconf_client_get_bool (vino_client,
 						   VINO_PREFS_REQUIRE_ENCRYPTION,
 						   NULL);
@@ -474,6 +508,13 @@
 			     NULL, NULL, NULL);
   i++;
 
+  vino_listeners [i] =
+    gconf_client_notify_add (vino_client,
+			     VINO_PREFS_ALWAYS_SHOW_TRAY_ICON,
+			     (GConfClientNotifyFunc) vino_prefs_always_show_tray_icon_changed,
+			     NULL, NULL, NULL);
+  i++;
+
   g_assert (i == VINO_N_LISTENERS);
 }
 
diff -uNr vino-2.17.2/server/vino-server.c vino-2.17.2-wendell/server/vino-server.c
--- vino-2.17.2/server/vino-server.c	2006-10-27 05:00:32.000000000 -0300
+++ vino-2.17.2-wendell/server/vino-server.c	2006-11-15 21:11:28.000000000 -0300
@@ -24,7 +24,6 @@
 
 #include "vino-server.h"
 
-#include <rfb/rfb.h>
 #include "vino-fb.h"
 #ifdef VINO_ENABLE_HTTP_SERVER
 #include "vino-http.h"
@@ -63,12 +62,15 @@
   VinoAuthMethod    auth_methods;
   char             *vnc_password;
 
+  GtkStatusIcon     *icon;
+
 #ifdef VINO_ENABLE_HTTP_SERVER
   VinoHTTP         *http;
 #endif
 
   int               alternative_port;
 
+  guint             enabled : 1;
   guint             on_hold : 1;
   guint             local_only : 1;
   guint             prompt_enabled : 1;
@@ -76,30 +78,20 @@
   guint             require_encryption : 1;
   guint             last_auth_failed : 1;
   guint             use_alternative_port : 1;
+  guint             always_show_tray_icon : 1;
 };
 
-typedef struct
-{
-  rfbClientPtr  rfb_client;
-  GIOChannel   *io_channel;
-  guint         io_watch;
-  guint         update_timeout;
-
-  /* Deferred authentication */
-  guint         auth_timeout;
-  char         *auth_response;
-  int           auth_resp_len;
-} VinoServerClientInfo;
-
 enum
 {
   PROP_0,
+  PROP_ENABLED,
   PROP_SCREEN,
   PROP_ON_HOLD,
   PROP_PROMPT_ENABLED,
   PROP_VIEW_ONLY,
   PROP_LOCAL_ONLY,
   PROP_USE_ALTERNATIVE_PORT,
+  PROP_ALWAYS_SHOW_TRAY_ICON,
   PROP_ALTERNATIVE_PORT,
   PROP_REQUIRE_ENCRYPTION,
   PROP_AUTH_METHODS,
@@ -160,6 +152,9 @@
 
 	  g_free (l->data);
 	  server->priv->clients = g_slist_delete_link (server->priv->clients, l);
+
+          vino_server_update_tray_icon(server);
+
 	  break;
 	}
     }
@@ -324,6 +319,7 @@
     {
     case VINO_RESPONSE_ACCEPT:
       vino_server_set_client_on_hold (server, rfb_client->clientData, FALSE);
+      vino_server_update_tray_icon(server);
       break;
     case VINO_RESPONSE_REJECT:
       rfbCloseClient (rfb_client);
@@ -343,8 +339,10 @@
 
   g_return_val_if_fail (VINO_IS_SERVER (server), RFB_CLIENT_REFUSE);
 
-  if (!server->priv->prompt_enabled)
+  if (!server->priv->prompt_enabled) {
+    vino_server_update_tray_icon(server);
     return RFB_CLIENT_ACCEPT;
+  }
 
   vino_prompt_add_client (server->priv->prompt, rfb_client);
 
@@ -774,8 +772,296 @@
 #endif
 
   vino_mdns_add_service ("_rfb._tcp", rfb_screen->rfbPort);
+
+  /* tray icon initialisation */
+  vino_server_initialise_tray_icon(server);
+}
+
+/*************** START TRAY ICON STUFF ***********************/
+void
+vino_tray_icon_popup_menu_cb2 (GtkStatusIcon *status_icon, gpointer user_data)
+{
+  vino_tray_icon_popup_menu_cb (status_icon, 1, 1, user_data);
+}
+
+void
+vino_server_initialise_tray_icon (VinoServer *server)
+{
+  server->priv->icon = gtk_status_icon_new_from_icon_name("gnome-remote-desktop");
+
+  gtk_status_icon_set_visible (server->priv->icon, server->priv->always_show_tray_icon);
+
+  g_signal_connect_object (G_OBJECT (server->priv->icon),
+			 "popup_menu",
+			 G_CALLBACK (vino_tray_icon_popup_menu_cb),
+			 server, 0);
+
+  g_signal_connect_object (G_OBJECT (server->priv->icon),
+			 "activate",
+			 G_CALLBACK (vino_tray_icon_popup_menu_cb2),
+			 server, 0);
+
+}
+
+void vino_server_update_tray_icon(VinoServer *server)
+{
+  GSList *l;
+  int number_of_clients = 0;
+  gchar *tooltip = 0;
+
+  for (l = server->priv->clients; l; l = l->next)
+    number_of_clients++;
+
+  switch (number_of_clients) {
+    case 0: tooltip = "Nobody is connected to this machine."; break;
+    case 1: tooltip = "There is one person connected to this machine."; break;
+    default: sprintf(tooltip, "There are %d people connected to this machine.", number_of_clients); break;
+  }
+
+  if (number_of_clients > 0 || (server->priv->always_show_tray_icon && server->priv->enabled))
+    gtk_status_icon_set_visible(server->priv->icon, TRUE);
+  else
+    gtk_status_icon_set_visible(server->priv->icon, FALSE);
+  
+  gtk_status_icon_set_tooltip(server->priv->icon, tooltip);
+}
+
+void
+vino_tray_icon_disconnect_client_cb (GtkMenuItem *menuitem, VinoServerClientInfo *client)
+{
+  /*FIXME: Review these messages*/
+
+  GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG(gtk_message_dialog_new (NULL,
+						GTK_DIALOG_DESTROY_WITH_PARENT,
+						GTK_MESSAGE_OTHER,
+						GTK_BUTTONS_NONE,
+						_("Are you sure you want to disconnect the remote machine?")));
+
+  gtk_window_set_icon_name (GTK_WINDOW(dialog), "gnome-remote-desktop");
+  gtk_window_set_title (GTK_WINDOW(dialog), _("GNOME Remote Access - Confirmation"));
+  gtk_window_set_skip_taskbar_hint (GTK_WINDOW(dialog), FALSE);
+
+  GtkWidget *image = gtk_image_new_from_icon_name("gnome-remote-desktop", GTK_ICON_SIZE_DIALOG);
+  gtk_widget_show(image);
+  gtk_message_dialog_set_image(dialog, image);
+
+  gtk_dialog_add_buttons(GTK_DIALOG (dialog),
+                         _("Leave as it is"), GTK_RESPONSE_NO,
+                         _("Disconnect"), GTK_RESPONSE_YES,
+                         NULL);
+
+  gtk_message_dialog_format_secondary_text(dialog, 
+                        _("The remote user from the machine '%s' will be disconnected. Are you sure?"),
+                         client->rfb_client->host);
+
+  if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_YES)
+    {
+      rfbCloseClient (client->rfb_client);
+      rfbClientConnectionGone (client->rfb_client);
+    }
+
+  gtk_widget_destroy (GTK_WIDGET (image));
+  gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+void
+vino_tray_icon_popup_menu_cb (GtkStatusIcon *icon,
+			   guint button,
+			   guint time,
+                           VinoServer *server)
+{
+  GtkMenu *menu = (GtkMenu*) gtk_menu_new ();
+  GtkWidget *item;
+  VinoServerClientInfo *client = NULL;
+  GtkWidget *image;
+
+  GSList *l;
+  int number_of_clients = 0;
+  GString *client_info;
+
+  /* Preferences */
+  item = gtk_image_menu_item_new_with_mnemonic (_("_Preferences"));
+  image = gtk_image_new_from_icon_name (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+  g_signal_connect (G_OBJECT (item), "activate",
+		   G_CALLBACK (vino_tray_icon_show_preferences_cb), client);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+  /* Separator */
+  item = gtk_separator_menu_item_new ();
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+  /* Clients */
+  for (l = server->priv->clients; l; l = l->next)
+    number_of_clients++;
+
+  if (number_of_clients > 0) {
+    /* Information about connected clients */
+    item = gtk_image_menu_item_new_with_label (_("List of connected machines, click to disconnect"));
+    image = gtk_image_new_from_icon_name ("gnome-remote-desktop", GTK_ICON_SIZE_MENU);
+    gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+    /* List of clients */
+    for (l = server->priv->clients; l; l = l->next) {
+      client = (VinoServerClientInfo *) l->data;
+
+      client_info = g_string_new(client->rfb_client->host);
+      if (server->priv->view_only)
+        g_string_append(client_info, _(" is watching your desktop"));
+      else
+        g_string_append(client_info, _(" is controling your desktop"));
+
+      item = gtk_menu_item_new_with_label (client_info->str);
+      g_signal_connect (G_OBJECT (item), "activate",
+	  	      G_CALLBACK (vino_tray_icon_disconnect_client_cb), client);
+      gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+      
+      g_string_free(client_info, TRUE);
+    }
+
+    /* Separator */
+    item = gtk_separator_menu_item_new ();
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+    
+  }
+
+
+  /* Help */
+  item = gtk_image_menu_item_new_with_mnemonic (_("_Help"));
+  image = gtk_image_new_from_icon_name (GTK_STOCK_HELP, GTK_ICON_SIZE_MENU);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+  g_signal_connect (G_OBJECT (item), "activate",
+		  G_CALLBACK (vino_tray_icon_show_help_cb), icon);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+  /* About */
+  item = gtk_image_menu_item_new_with_mnemonic (_("_About"));
+  image = gtk_image_new_from_icon_name (GTK_STOCK_ABOUT, GTK_ICON_SIZE_MENU);
+  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+  g_signal_connect (G_OBJECT (item), "activate",
+		  G_CALLBACK (vino_tray_icon_show_about_cb), icon);
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+
+  gtk_widget_show_all (GTK_WIDGET (menu));
+  gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
+		gtk_status_icon_position_menu, icon,
+		1, gtk_get_current_event_time());
+
+}
+
+void
+vino_tray_icon_show_preferences_cb (GtkMenuItem *item, gpointer data)
+{
+  const gchar *command = "vino-preferences";
+  GError *error = NULL;
+
+  if (! g_spawn_command_line_async (command, &error))
+    {
+      GtkWidget *message_dialog;
+
+      message_dialog = gtk_message_dialog_new (NULL,
+					       GTK_DIALOG_DESTROY_WITH_PARENT,
+					       GTK_MESSAGE_ERROR,
+					       GTK_BUTTONS_CLOSE,
+					       _("There was an error displaying preferences:\n%s"),
+					       error->message);
+      gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE);
+
+      g_signal_connect (message_dialog, "response",
+			G_CALLBACK (gtk_widget_destroy),
+			NULL);
+
+      gtk_widget_show (message_dialog);
+
+      g_error_free (error);
+    }
+}
+
+void
+vino_tray_icon_show_help_cb (GtkMenuItem *item, gpointer data)
+{
+  const gchar *command = "yelp ghelp:user-guide?goscustdesk-90";
+  GError *error = NULL;
+
+  if (! g_spawn_command_line_async (command, &error))
+    {
+      GtkWidget *message_dialog;
+
+      message_dialog = gtk_message_dialog_new (NULL,
+					       GTK_DIALOG_DESTROY_WITH_PARENT,
+					       GTK_MESSAGE_ERROR,
+					       GTK_BUTTONS_CLOSE,
+					       _("There was an error displaying help:\n%s"),
+					       error->message);
+      gtk_window_set_resizable (GTK_WINDOW (message_dialog), FALSE);
+
+      g_signal_connect (message_dialog, "response",
+			G_CALLBACK (gtk_widget_destroy),
+			NULL);
+
+      gtk_widget_show (message_dialog);
+
+      g_error_free (error);
+    }
+}
+
+void
+vino_tray_icon_show_about_cb (GtkMenuItem *item, gpointer data)
+{
+	const char *authors[] = {
+		"Mark McLoughlin  <mark@skynet.ie>",
+		"Calum Benson <calum.benson@sun.com>",
+		NULL};
+	//const char *documenters[] = {
+	//	NULL};
+	//const char *artists[] = {
+	//	NULL};
+	const char *license[] = {
+		N_("Licensed under the GNU General Public License Version 2"),
+		N_("Power Manager is free software; you can redistribute it and/or\n"
+		   "modify it under the terms of the GNU General Public License\n"
+		   "as published by the Free Software Foundation; either version 2\n"
+		   "of the License, or (at your option) any later version."),
+		N_("Power Manager is distributed in the hope that it will be useful,\n"
+		   "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+		   "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
+		   "GNU General Public License for more details."),
+		N_("You should have received a copy of the GNU General Public License\n"
+		   "along with this program; if not, write to the Free Software\n"
+		   "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\n"
+		   "02110-1301, USA.")
+	};
+  	const char  *translators = _("translator-credits");
+	char	    *license_trans;
+
+	/* Translators comment: put your own name here to appear in the about dialog. */
+  	if (!strcmp (translators, "translator-credits")) {
+		translators = NULL;
+	}
+
+	license_trans = g_strconcat (_(license[0]), "\n\n", _(license[1]), "\n\n",
+				     _(license[2]), "\n\n", _(license[3]), "\n",  NULL);
+
+	gtk_window_set_default_icon_name ("gnome-remote-desktop");
+	gtk_show_about_dialog (NULL,
+			       "name", _("GNOME Remote Access"),
+			       "version", VERSION,
+			       //"copyright", "Copyright \xc2\xa9 2005-2006 Richard Hughes",
+			       "license", license_trans,
+			       //"website", "www",
+			       "comments", _("Shares your desktop with others"),
+			       "authors", authors,
+			       //"documenters", documenters,
+			       //"artists", artists,
+			       "translator-credits", translators,
+			       "logo-icon-name", "gnome-remote-desktop",
+			       NULL);
+	g_free (license_trans);
 }
 
+/*************** END TRAY ICON STUFF ***********************/
+
 static void
 vino_server_finalize (GObject *object)
 {
@@ -841,6 +1127,9 @@
 
   switch (prop_id)
     {
+    case PROP_ENABLED:
+      vino_server_set_enabled (server, g_value_get_boolean (value));
+      break;
     case PROP_SCREEN:
       vino_server_init_from_screen (server, g_value_get_object (value));
       break;
@@ -871,6 +1160,9 @@
     case PROP_ALTERNATIVE_PORT:
       vino_server_set_alternative_port (server, g_value_get_int (value));
       break;
+    case PROP_ALWAYS_SHOW_TRAY_ICON:
+      vino_server_set_always_show_tray_icon (server, g_value_get_boolean (value));
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -887,6 +1179,9 @@
 
   switch (prop_id)
     {
+    case PROP_ENABLED:
+      g_value_set_boolean (value, server->priv->enabled);
+      break;
     case PROP_SCREEN:
       g_value_set_object (value, server->priv->screen);
       break;
@@ -917,6 +1212,9 @@
     case PROP_ALTERNATIVE_PORT:
       g_value_set_int (value, server->priv->alternative_port);
       break;
+    case PROP_ALWAYS_SHOW_TRAY_ICON:
+      g_value_set_boolean (value, server->priv->always_show_tray_icon);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -941,6 +1239,14 @@
   gobject_class->get_property = vino_server_get_property;
 
   g_object_class_install_property (gobject_class,
+				   PROP_ON_HOLD,
+				   g_param_spec_boolean ("enabled",
+							 _("Server enabled"),
+							 _("If True, the server is active"),
+							 TRUE,
+							 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
+  g_object_class_install_property (gobject_class,
 				   PROP_SCREEN,
 				   g_param_spec_object ("screen",
 							_("Screen"),
@@ -1022,6 +1328,14 @@
 						     VINO_SERVER_MAX_PORT,
 						     VINO_SERVER_DEFAULT_PORT,
 						     G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+  g_object_class_install_property (gobject_class,
+				   PROP_ALWAYS_SHOW_TRAY_ICON,
+				   g_param_spec_boolean ("always-show-tray-icon",
+							 _("Always show the tray icon"),
+							 _("If TRUE, the icon is showed on notification area even when there is not any remote machine connected"),
+							 FALSE,
+							 G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
+
 }
 
 GType
@@ -1065,6 +1379,31 @@
 		       NULL);
 }
 
+void
+vino_server_set_enabled (VinoServer *server,
+			 gboolean  enabled)
+{
+  g_return_if_fail (VINO_IS_SERVER (server));
+
+  enabled = enabled != FALSE;
+
+  if (server->priv->enabled != enabled)
+    {
+      server->priv->enabled = enabled;
+
+      vino_server_update_tray_icon(server);
+      g_object_notify (G_OBJECT (server), "enabled");
+    }
+}
+
+gboolean
+vino_server_get_enabled (VinoServer *server)
+{
+  g_return_val_if_fail (VINO_IS_SERVER (server), FALSE);
+
+  return server->priv->enabled;
+}
+
 GdkScreen *
 vino_server_get_screen (VinoServer *server)
 {
@@ -1186,6 +1525,31 @@
 }
 
 gboolean
+vino_server_get_always_show_tray_icon (VinoServer *server)
+{
+  g_return_val_if_fail (VINO_IS_SERVER (server), FALSE);
+
+  return server->priv->always_show_tray_icon;
+}
+
+void
+vino_server_set_always_show_tray_icon (VinoServer *server,
+                                       gboolean    always_show_tray_icon)
+{
+  g_return_if_fail (VINO_IS_SERVER (server));
+
+  always_show_tray_icon = always_show_tray_icon != FALSE;
+
+  if (server->priv->always_show_tray_icon != always_show_tray_icon)
+    {
+      server->priv->always_show_tray_icon = always_show_tray_icon;
+
+      vino_server_update_tray_icon(server);
+      g_object_notify (G_OBJECT (server), "always-show-tray-icon");
+    }
+}
+
+gboolean
 vino_server_get_on_hold (VinoServer *server)
 {
   g_return_val_if_fail (VINO_IS_SERVER (server), FALSE);
diff -uNr vino-2.17.2/server/vino-server.h vino-2.17.2-wendell/server/vino-server.h
--- vino-2.17.2/server/vino-server.h	2006-10-13 05:48:29.000000000 -0300
+++ vino-2.17.2-wendell/server/vino-server.h	2006-11-15 21:11:28.000000000 -0300
@@ -25,12 +25,14 @@
 
 #include <glib-object.h>
 #include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <rfb/rfb.h>
 
 G_BEGIN_DECLS
 
 #define VINO_SERVER_DEFAULT_PORT  5900
 #define VINO_SERVER_MIN_PORT      5000
-#define VINO_SERVER_MAX_PORT      50000
+#define VINO_SERVER_MAX_PORT      32767
 #define VINO_SERVER_VALID_PORT(p) ((p) > VINO_SERVER_MIN_PORT && (p) < VINO_SERVER_MAX_PORT)
 
 #define VINO_TYPE_SERVER         (vino_server_get_type ())
@@ -63,38 +65,74 @@
   GObjectClass base_class;
 };
 
-GType                vino_server_get_type                 (void) G_GNUC_CONST;
-
-VinoServer          *vino_server_new                      (GdkScreen      *screen,
-							   gboolean        view_only);
-GdkScreen           *vino_server_get_screen               (VinoServer     *server);
-void                 vino_server_set_on_hold              (VinoServer     *server,
-							   gboolean        on_hold);
-gboolean             vino_server_get_on_hold              (VinoServer     *server);
-void                 vino_server_set_prompt_enabled       (VinoServer     *server,
-							   gboolean        enable_prompt);
-gboolean             vino_server_get_prompt_enabled       (VinoServer     *server);
-void                 vino_server_set_view_only            (VinoServer     *server,
+typedef struct
+{
+  rfbClientPtr  rfb_client;
+  GIOChannel   *io_channel;
+  guint         io_watch;
+  guint         update_timeout;
+
+  /* Deferred authentication */
+  guint         auth_timeout;
+  char         *auth_response;
+  int           auth_resp_len;
+} VinoServerClientInfo;
+
+GType                vino_server_get_type                  (void) G_GNUC_CONST;
+
+VinoServer          *vino_server_new                       (GdkScreen      *screen,
+							    gboolean        view_only);
+GdkScreen           *vino_server_get_screen                (VinoServer     *server);
+void                 vino_server_set_on_hold               (VinoServer     *server,
+							    gboolean        on_hold);
+gboolean             vino_server_get_on_hold               (VinoServer     *server);
+void                 vino_server_set_enabled               (VinoServer     *server,
+							    gboolean        enabled);
+gboolean             vino_server_get_enabled               (VinoServer     *server);
+void                 vino_server_set_prompt_enabled        (VinoServer     *server,
+							    gboolean        enable_prompt);
+gboolean             vino_server_get_prompt_enabled        (VinoServer     *server);
+void                 vino_server_set_view_only             (VinoServer     *server,
 							   gboolean        view_only);
-gboolean             vino_server_get_use_alternative_port (VinoServer     *server);
-void                 vino_server_set_use_alternative_port (VinoServer     *server,
+gboolean             vino_server_get_use_alternative_port  (VinoServer     *server);
+void                 vino_server_set_use_alternative_port  (VinoServer     *server,
 							   gboolean        use_alternative_port);
-int                  vino_server_get_alternative_port     (VinoServer     *server);
-void                 vino_server_set_alternative_port     (VinoServer     *server,
-							   int             alternative_port);
-gboolean             vino_server_get_view_only            (VinoServer     *server);
-void                 vino_server_set_local_only           (VinoServer     *server,
-							   gboolean        local_only);
-gboolean             vino_server_get_local_only           (VinoServer     *server);
-void                 vino_server_set_require_encryption   (VinoServer     *server,
-							   gboolean        require_encryption);
-gboolean             vino_server_get_require_encryption   (VinoServer     *server);
-void                 vino_server_set_auth_methods         (VinoServer     *server,
-							   VinoAuthMethod  auth_methods);
-VinoAuthMethod       vino_server_get_auth_methods         (VinoServer     *server);
-void                 vino_server_set_vnc_password         (VinoServer     *server,
-							   const char     *vnc_password);
-G_CONST_RETURN char *vino_server_get_vnc_password         (VinoServer     *server);
+int                  vino_server_get_alternative_port      (VinoServer     *server);
+void                 vino_server_set_alternative_port      (VinoServer     *server,
+							    int             alternative_port);
+gboolean             vino_server_get_view_only             (VinoServer     *server);
+void                 vino_server_set_local_only            (VinoServer     *server,
+							    gboolean        local_only);
+gboolean             vino_server_get_local_only            (VinoServer     *server);
+void                 vino_server_set_require_encryption    (VinoServer     *server,
+							    gboolean        require_encryption);
+gboolean             vino_server_get_require_encryption    (VinoServer     *server);
+void                 vino_server_set_auth_methods          (VinoServer     *server,
+							    VinoAuthMethod  auth_methods);
+VinoAuthMethod       vino_server_get_auth_methods          (VinoServer     *server);
+void                 vino_server_set_vnc_password          (VinoServer     *server,
+							    const char     *vnc_password);
+G_CONST_RETURN char *vino_server_get_vnc_password          (VinoServer     *server);
+
+void                 vino_server_update_tray_icon          (VinoServer     *server);
+void                 vino_server_initialise_tray_icon      (VinoServer     *server);
+void                 vino_tray_icon_popup_menu_cb          (GtkStatusIcon *icon,
+							    guint button,
+							    guint time,
+							    VinoServer *server);
+void                 vino_tray_icon_popup_menu_cb2         (GtkStatusIcon *status_icon,
+           						    gpointer user_data);
+
+void                 vino_tray_icon_show_preferences_cb    (GtkMenuItem *item, gpointer data);
+void                 vino_tray_icon_show_help_cb           (GtkMenuItem *item, gpointer data);
+void                 vino_tray_icon_show_about_cb          (GtkMenuItem *item, gpointer data);
+
+int                  vino_server_get_always_show_tray_icon (VinoServer     *server);
+void                 vino_server_set_always_show_tray_icon (VinoServer     *server,
+                                                            gboolean        always_show_tray_icon);
+void                 vino_tray_icon_disconnect_client_cb   (GtkMenuItem *menuitem,
+                                                            VinoServerClientInfo *client);
+
 
 G_END_DECLS
 
diff -uNr vino-2.17.2/server/vino-server.schemas.in vino-2.17.2-wendell/server/vino-server.schemas.in
--- vino-2.17.2/server/vino-server.schemas.in	2006-10-13 05:48:29.000000000 -0300
+++ vino-2.17.2-wendell/server/vino-server.schemas.in	2006-11-15 21:11:28.000000000 -0300
@@ -169,5 +169,22 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/desktop/gnome/remote_access/always_show_tray_icon</key>
+      <applyto>/desktop/gnome/remote_access/always_show_tray_icon</applyto>
+      <owner>gnome</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>Always show the icon on notification area</short>
+         <long>
+           If true, an icon will always be showed in notification area
+           when server is active, even when there are no remote machines
+           connected. If False, the icon only will be showed if a remote
+           connection exists.
+         </long>
+      </locale>
+    </schema>
+
   </schemalist>  
 </gconfschemafile>
