raveit65 pushed to mate-screensaver (epel7). "fix user switching if more than 2 desktop managers are installed"
notifications at fedoraproject.org
notifications at fedoraproject.org
Wed Apr 1 20:58:33 UTC 2015
>From 8d8b056ed7d7fe71e5a5b372884885433f9cdae3 Mon Sep 17 00:00:00 2001
From: raveit65 <chat-to-me at raveit.de>
Date: Wed, 1 Apr 2015 22:51:24 +0200
Subject: fix user switching if more than 2 desktop managers are installed
diff --git a/mate-screensaver.spec b/mate-screensaver.spec
index 4dc766d..e9f6adf 100644
--- a/mate-screensaver.spec
+++ b/mate-screensaver.spec
@@ -14,7 +14,7 @@
Name: mate-screensaver
Version: %{branch}.1
-Release: 3%{?dist}
+Release: 4%{?dist}
#Release: 0.1%{?git_rel}%{?dist}
Summary: MATE Screensaver
License: GPLv2+ and LGPLv2+
@@ -26,19 +26,14 @@ URL: http://pub.mate-desktop.org
# Source for snapshot-builds.
%{!?rel_build:Source0: http://git.mate-desktop.org/%{name}/snapshot/%{name}-%{commit}.tar.xz#/%{git_tar}}
-Patch0: mate-screensaver_use-gdm-as-last-condition-for-user-switch.patch
-# upstream patch
+# https://github.com/mate-desktop/mate-screensaver/pull/70
+Patch0: mate-screensaver_check-for-running-dm-for-user-switch.patch
+# rhbz (#1199754)
Patch1: mate-screensaver_fix-polish-translation.patch
Requires: redhat-menus
Requires: system-logos
-
-# switch to gnome-keyring > f19
-%if 0%{?fedora} > 19
Requires: gnome-keyring-pam
-%else
-Requires: mate-keyring-pam
-%endif
BuildRequires: dbus-glib-devel
BuildRequires: desktop-file-utils
@@ -76,7 +71,7 @@ Development files for mate-screensaver
%prep
%setup -q%{!?rel_build:n %{name}-%{commit}}
-%patch0 -p1 -b .gdm
+%patch0 -p1 -b .user-switch
%patch1 -p1 -b .translation
# needed for git snapshots
@@ -154,6 +149,10 @@ fi
%changelog
+* Wed Apr 01 2015 Wolfgang Ulbrich <chat-to-me at raveit.de> - 1.8.1-4
+- fix user switching if more than 2 desktop managers are installed
+- remove conditions for f19
+
* Mon Mar 10 2015 Wolfgang Ulbrich <chat-to-me at raveit.de> - 1.8.1-3
- fix polish translation rhbz (#1199754)
diff --git a/mate-screensaver_check-for-running-dm-for-user-switch.patch b/mate-screensaver_check-for-running-dm-for-user-switch.patch
new file mode 100644
index 0000000..3f26683
--- /dev/null
+++ b/mate-screensaver_check-for-running-dm-for-user-switch.patch
@@ -0,0 +1,70 @@
+diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c
+index 91fac54..34aa87a 100644
+--- a/src/gs-lock-plug.c
++++ b/src/gs-lock-plug.c
+@@ -188,18 +188,20 @@ gs_lock_plug_style_set (GtkWidget *widget,
+ }
+
+ static gboolean
+-is_program_in_path (const char *program)
++process_is_running (const char * name)
+ {
+- char *tmp = g_find_program_in_path (program);
+- if (tmp != NULL)
+- {
+- g_free (tmp);
+- return TRUE;
+- }
+- else
+- {
+- return FALSE;
+- }
++ int num_processes;
++ gchar *command = g_strdup_printf ("pidof %s | wc -l", name);
++ FILE *fp = popen(command, "r");
++ fscanf(fp, "%d", &num_processes);
++ pclose(fp);
++ g_free (command);
++
++ if (num_processes > 0) {
++ return TRUE;
++ } else {
++ return FALSE;
++ }
+ }
+
+ static void
+@@ -209,7 +211,7 @@ do_user_switch (GSLockPlug *plug)
+ gboolean res;
+ char *command;
+
+- if (is_program_in_path (MDM_FLEXISERVER_COMMAND))
++ if (process_is_running ("mdm"))
+ {
+ /* MDM */
+ command = g_strdup_printf ("%s %s",
+@@ -229,7 +231,7 @@ do_user_switch (GSLockPlug *plug)
+ g_error_free (error);
+ }
+ }
+- else if (is_program_in_path (GDM_FLEXISERVER_COMMAND))
++ else if (process_is_running ("gdm") || process_is_running("gdm3"))
+ {
+ /* GDM */
+ command = g_strdup_printf ("%s %s",
+@@ -1284,12 +1286,12 @@ gs_lock_plug_set_switch_enabled (GSLockPlug *plug,
+
+ if (switch_enabled)
+ {
+- if (is_program_in_path (MDM_FLEXISERVER_COMMAND))
++ if (process_is_running ("mdm"))
+ {
+ /* MDM */
+ gtk_widget_show (plug->priv->auth_switch_button);
+ }
+- else if (is_program_in_path (GDM_FLEXISERVER_COMMAND))
++ else if (process_is_running ("gdm") || process_is_running("gdm3"))
+ {
+ /* GDM */
+ gtk_widget_show (plug->priv->auth_switch_button);
+
diff --git a/mate-screensaver_use-gdm-as-last-condition-for-user-switch.patch b/mate-screensaver_use-gdm-as-last-condition-for-user-switch.patch
deleted file mode 100644
index ceb5bfa..0000000
--- a/mate-screensaver_use-gdm-as-last-condition-for-user-switch.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -upr mate-screensaver-1.8.1-orig/src/gs-lock-plug.c mate-screensaver-1.8.1/src/gs-lock-plug.c
---- mate-screensaver-1.8.1-orig/src/gs-lock-plug.c 2014-09-25 14:46:12.000000000 +0200
-+++ mate-screensaver-1.8.1/src/gs-lock-plug.c 2015-02-20 15:33:36.888982325 +0100
-@@ -229,25 +229,6 @@ do_user_switch (GSLockPlug *plug)
- g_error_free (error);
- }
- }
-- else if (is_program_in_path (GDM_FLEXISERVER_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 (),
-- command,
-- &error);
--
-- g_free (command);
--
-- if (! res) {
-- gs_debug ("Unable to start GDM greeter: %s", error->message);
-- g_error_free (error);
-- }
-- }
- else if (g_getenv ("XDG_SEAT_PATH") != NULL)
- {
- /* LightDM */
-@@ -278,7 +259,25 @@ do_user_switch (GSLockPlug *plug)
- g_error_free (error);
- }
- }
-+ else if (is_program_in_path (GDM_FLEXISERVER_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 (),
-+ command,
-+ &error);
-
-+ g_free (command);
-+
-+ if (! res) {
-+ gs_debug ("Unable to start GDM greeter: %s", error->message);
-+ g_error_free (error);
-+ }
-+ }
- }
-
- static void
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/mate-screensaver.git/commit/?h=epel7&id=8d8b056ed7d7fe71e5a5b372884885433f9cdae3
More information about the scm-commits
mailing list