[vino] Get started by the g-s-d sharing plugin



commit 18be3c5546172bce551b65d60ec2c931bc451398
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 18 16:43:37 2014 +0200

    Get started by the g-s-d sharing plugin
    
    Remove the AutostartCondition so that we're started by the
    gnome-settings-daemon sharing plugin, not by gnome-session
    directly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731862

 Makefile.am                       |    6 ++--
 common/org.gnome.Vino.gschema.xml |   10 ------
 server/vino-main.c                |   65 +-----------------------------------
 server/vino-prefs.c               |   14 --------
 server/vino-server.desktop.in.in  |    3 +-
 5 files changed, 6 insertions(+), 92 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6385e43..8abc3d3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -244,9 +244,9 @@ nodist_service_DATA = server/org.freedesktop.Telepathy.Client.Vino.service
 server/org.freedesktop.Telepathy.Client.Vino.service: server/org.freedesktop.Telepathy.Client.Vino.service.in
        $(AM_V_GEN)$(SED) -e "s|[ ]libexecdir[@]|$(libexecdir)|" $< > $@
 
-autostartdir = $(sysconfdir)/xdg/autostart
-autostart_in_files = server/vino-server.desktop.in
-nodist_autostart_DATA = $(autostart_in_files:.desktop.in=.desktop)
+applicationsdir = $(datadir)/applications/
+applications_in_files = server/vino-server.desktop.in
+nodist_applications_DATA = $(applications_in_files:.desktop.in=.desktop)
 
 @INTLTOOL_DESKTOP_RULE@
 
diff --git a/common/org.gnome.Vino.gschema.xml b/common/org.gnome.Vino.gschema.xml
index 01b6ea9..3c9cfe5 100644
--- a/common/org.gnome.Vino.gschema.xml
+++ b/common/org.gnome.Vino.gschema.xml
@@ -1,15 +1,5 @@
 <schemalist>
   <schema id='org.gnome.Vino' path='/org/gnome/desktop/remote-access/'>
-    <key name='enabled' type='b'>
-      <summary>Enable remote access to the desktop</summary>
-      <description>
-        If true, allows remote access to the desktop via the RFB
-        protocol. Users on remote machines may then connect to the
-        desktop using a VNC viewer.
-      </description>
-      <default>false</default>
-    </key>
-
     <key name='prompt-enabled' type='b'>
       <summary>Prompt the user before completing a connection</summary>
       <description>
diff --git a/server/vino-main.c b/server/vino-main.c
index 4740a2e..1f2b2b1 100644
--- a/server/vino-main.c
+++ b/server/vino-main.c
@@ -78,61 +78,12 @@ typedef enum
 static RunMode
 get_run_mode (VinoApplication *vino)
 {
-  if (g_settings_get_boolean (vino->settings, "enabled"))
-    return RUN_MODE_ALL;
-
 #ifdef VINO_HAVE_TELEPATHY_GLIB
   if (tube)
     return RUN_MODE_TUBE;
 #endif
 
-  return RUN_MODE_EXIT;
-}
-
-static void
-set_all_servers_reject(VinoApplication *vino,
-    gboolean reject)
-{
-  guint i;
-
-  for (i = 0; i < vino->n_screens; i++)
-    {
-      VinoServer *server;
-
-      server = vino_dbus_listener_get_server (vino->listeners[i]);
-
-      vino_server_set_reject_incoming (server, reject);
-    }
-}
-
-static void
-enabled_changed (VinoApplication *vino)
-{
-  RunMode mode;
-  gboolean reject;
-
-  mode = get_run_mode (vino);
-  if (mode == RUN_MODE_EXIT)
-    {
-      g_message ("The desktop sharing service has been disabled, exiting.");
-      g_main_loop_quit (vino->main_loop);
-      return;
-    }
-
-  if (mode == RUN_MODE_TUBE)
-    {
-      g_message ("The desktop sharing service has been disabled, "
-          "reject network connections");
-      reject = TRUE;
-    }
-  else
-    {
-      g_message ("The desktop sharing service has been enabled, "
-          "accept network connections");
-      reject = FALSE;
-    }
-
-  set_all_servers_reject (vino, reject);
+  return RUN_MODE_ALL;
 }
 
 #ifdef VINO_HAVE_TELEPATHY_GLIB
@@ -251,10 +202,7 @@ name_acquired (GDBusConnection *connection,
       vino_server_set_on_hold (server, FALSE);
       vino_server_set_reject_incoming (server, reject);
 
-      if (g_settings_get_boolean (vino->settings, "enabled"))
-        {
-          vino_mdns_start(vino_server_get_network_interface (server));
-        }
+      vino_mdns_start(vino_server_get_network_interface (server));
 
       g_object_unref (server);
     }
@@ -322,15 +270,6 @@ main (int argc, char **argv)
 
   /* GSettings */
   vino.settings = g_settings_new ("org.gnome.Vino");
-  g_signal_connect_swapped (vino.settings, "changed::enabled",
-                            G_CALLBACK (enabled_changed), &vino);
-
-  if (get_run_mode (&vino) == RUN_MODE_EXIT)
-    {
-      g_warning ("The desktop sharing service is not "
-                 "enabled, so it should not be run.");
-      return 1;
-    }
 
   gtk_window_set_default_icon_name ("preferences-desktop-remote-desktop");
   g_set_application_name (_("GNOME Desktop Sharing"));
diff --git a/server/vino-prefs.c b/server/vino-prefs.c
index 3aca534..a35dec4 100644
--- a/server/vino-prefs.c
+++ b/server/vino-prefs.c
@@ -114,16 +114,6 @@ vino_prefs_sighandler (int sig)
   exit (0);
 }
 
-static void
-notify_enabled (void)
-{
-  if (!g_settings_get_boolean (settings, "enabled"))
-    {
-      g_message ("The desktop sharing service is disabled, exiting.");
-      exit (0);
-    }
-}
-
 void
 vino_prefs_init (gboolean view_only)
 {
@@ -134,10 +124,6 @@ vino_prefs_init (gboolean view_only)
   signal (SIGTERM, vino_prefs_sighandler); /* kill -15 */
   signal (SIGSEGV, vino_prefs_sighandler); /* Segmentation fault */
 
-  g_signal_connect (settings, "changed::enabled",
-                    G_CALLBACK (notify_enabled), NULL);
-  notify_enabled ();
-
   force_view_only = view_only;
 }
 
diff --git a/server/vino-server.desktop.in.in b/server/vino-server.desktop.in.in
index f87b8bd..d3b195d 100644
--- a/server/vino-server.desktop.in.in
+++ b/server/vino-server.desktop.in.in
@@ -4,10 +4,9 @@ _Comment=GNOME Desktop Sharing Server
 _Keywords=vnc;share;remote;
 Exec= LIBEXECDIR@/vino-server
 Icon=preferences-desktop-remote-desktop
-OnlyShowIn=GNOME;Unity;
+NoDisplay=true
 Terminal=false
 Type=Application
-AutostartCondition=GSettings org.gnome.Vino enabled
 X-GNOME-Autostart-Phase=Applications
 X-GNOME-AutoRestart=true
 X-GNOME-UsesNotifications=true


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