[Xfce4-commits] [apps/xfce4-screensaver] 20/425: add GDM support for user switch

noreply at xfce.org noreply at xfce.org
Mon Oct 15 01:47:47 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit f51cc7168688b39495a55fa37a38d3a1a1fdce6b
Author: Stefano Karapetsas <stefano at karapetsas.com>
Date:   Fri May 25 14:49:24 2012 +0200

    add GDM support for user switch
---
 src/gs-lock-plug.c | 77 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 63 insertions(+), 14 deletions(-)

diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
index 81bea13..daf2632 100644
--- a/src/gs-lock-plug.c
+++ b/src/gs-lock-plug.c
@@ -52,9 +52,13 @@
 #include "gs-debug.h"
 
 #define KEY_LOCK_DIALOG_THEME "/apps/mate-screensaver/lock_dialog_theme"
+
 #define MDM_FLEXISERVER_COMMAND "mdmflexiserver"
 #define MDM_FLEXISERVER_ARGS    "--startnew Standard"
 
+#define GDM_FLEXISERVER_COMMAND "gdmflexiserver"
+#define GDM_FLEXISERVER_ARGS    "--startnew Standard"
+
 /* same as SMS ;) */
 #define NOTE_BUFFER_MAX_CHARS 160
 
@@ -175,21 +179,56 @@ do_user_switch (GSLockPlug *plug)
 	gboolean res;
 	char    *command;
 
-	command = g_strdup_printf ("%s %s",
-	                           MDM_FLEXISERVER_COMMAND,
-	                           MDM_FLEXISERVER_ARGS);
+	gboolean found;
+	found = is_program_in_path (MDM_FLEXISERVER_COMMAND);
 
-	error = NULL;
-	res = gdk_spawn_command_line_on_screen (gdk_screen_get_default (),
-	                                        command,
-	                                        &error);
+	if (found)
+	{
 
-	g_free (command);
+		command = g_strdup_printf ("%s %s",
+								   MDM_FLEXISERVER_COMMAND,
+								   MDM_FLEXISERVER_ARGS);
 
-	if (! res)
-	{
-		gs_debug ("Unable to start MDM greeter: %s", error->message);
-		g_error_free (error);
+		error = NULL;
+		res = gdk_spawn_command_line_on_screen (gdk_screen_get_default (),
+												command,
+												&error);
+
+		g_free (command);
+
+		if (! res)
+		{
+			gs_debug ("Unable to start MDM greeter: %s", error->message);
+			g_error_free (error);
+		}
+	}
+	else {
+		
+		/* MDM not found, so we try to use gdmflexiserver from GDM */
+		
+		found = is_program_in_path (GDM_FLEXISERVER_COMMAND);
+		
+		if (found)
+		{
+                
+			char    *gdm_command;
+
+			gdm_command = g_strdup_printf ("%s %s",
+										   GDM_FLEXISERVER_COMMAND,
+										   GDM_FLEXISERVER_ARGS);
+			
+			error = NULL;
+			res = gdk_spawn_command_line_on_screen (gdk_screen_get_default (),
+											gdm_command,
+											&error);
+
+			g_free (gdm_command);
+			
+			if (! res) {
+				gs_debug ("Unable to start MDM greeter: %s", error->message);
+				g_error_free (error);
+			}
+		}
 	}
 }
 
@@ -976,8 +1015,18 @@ gs_lock_plug_set_switch_enabled (GSLockPlug *plug,
 		}
 		else
 		{
-			gs_debug ("Waring: MDM flexiserver command not found: %s", MDM_FLEXISERVER_COMMAND);
-			gtk_widget_hide (plug->priv->auth_switch_button);
+			gs_debug ("Warning: MDM flexiserver command not found: %s", MDM_FLEXISERVER_COMMAND);
+			
+			/* MDM not found, so we try to use gdmflexiserver from GDM */
+			found = is_program_in_path (GDM_FLEXISERVER_COMMAND);
+			if (found)
+			{
+				gtk_widget_show (plug->priv->auth_switch_button);
+			}
+			else {
+				gs_debug ("Warning: GDM flexiserver command not found: %s", GDM_FLEXISERVER_COMMAND);
+				gtk_widget_hide (plug->priv->auth_switch_button);
+			}
 		}
 	}
 	else

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list