1
0
forked from pool/xfce4-session

- update to version 4.10.1

- remove xfce environment functions and use glib
  - add shutdown/reboot functionality for systemd
  - fix logic of the --fast action
  - bump copyright year
  - store the child watch id to avoid possible double free
  - use the async spawn function of glib
  - autotools updates
  - remove gnome-keyring remains
  - handle multiple interactive session save
  - translation updates
- remove obsolete xfce4-session-avoid-possible-double-free.patch,
  xfce4-session-handle-multiple-interactive-session-save.patch

OBS-URL: https://build.opensuse.org/package/show/X11:xfce/xfce4-session?expand=0&rev=109
This commit is contained in:
Guido Berhoerster 2013-06-07 09:26:12 +00:00 committed by Git OBS Bridge
parent ff82a83e2b
commit c2634b2111
6 changed files with 29 additions and 237 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb8aa9a74c3d382840596fb4875144d66c7f3f47c8e9ee81d31e3428a72c46ce
size 1257385

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0154fabdc398798c3445374ccc52a2f5bcb2d867fc94bc54114395b24f9cfc83
size 1273015

View File

@ -1,80 +0,0 @@
Index: xfce4-session-4.10.0/xfce4-session/xfsm-startup.c
===================================================================
--- xfce4-session-4.10.0.orig/xfce4-session/xfsm-startup.c
+++ xfce4-session-4.10.0/xfce4-session/xfsm-startup.c
@@ -864,6 +864,7 @@ xfsm_startup_start_properties (XfsmPrope
gint n;
const gchar *current_directory;
GPid pid;
+ GError *error = NULL;
/* release any possible old resources related to a previous startup */
xfsm_properties_set_default_child_watch (properties);
@@ -878,49 +879,34 @@ xfsm_startup_start_properties (XfsmPrope
current_directory = xfsm_properties_get_string (properties, SmCurrentDirectory);
- /* fork a new process for the application */
-#ifdef HAVE_VFORK
- /* vfork() doesn't allow you to do anything but call exec*() or _exit(),
- * so if we need to set the working directory, we can't use vfork() */
- if (current_directory == NULL)
- pid = vfork ();
- else
-#endif
- pid = fork ();
-
- /* handle the child process */
- if (pid == 0)
+ if (!g_spawn_async (current_directory,
+ argv, NULL,
+ G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH,
+ NULL, NULL,
+ &pid, &error))
{
- /* execute the application here */
- if (current_directory)
- {
- if (chdir (current_directory))
- g_warning ("Unable to chdir to \"%s\": %s", current_directory, strerror (errno));
- }
- execvp (argv[0], argv);
- _exit (127);
- }
-
- /* cleanup */
- g_strfreev (argv);
+ g_warning ("Unable to launch \"%s\": %s",
+ *argv, error->message);
+ g_error_free (error);
+ g_strfreev (argv);
- /* check if we failed to fork */
- if (G_UNLIKELY (pid < 0))
- {
- /* tell the user that we failed to fork */
- perror ("Failed to fork new process");
return FALSE;
}
+ xfsm_verbose ("Launched command \"%s\" with PID %dn", *argv, (gint) pid);
+
+ g_strfreev (argv);
+
properties->pid = pid;
/* set a watch to make sure the child doesn't quit before registering */
- child_watch_data = g_new (XfsmStartupData, 1);
+ child_watch_data = g_new0 (XfsmStartupData, 1);
child_watch_data->manager = g_object_ref (manager);
child_watch_data->properties = properties;
- g_child_watch_add_full (G_PRIORITY_LOW, properties->pid,
- xfsm_startup_child_watch, child_watch_data,
- (GDestroyNotify) xfsm_startup_data_free);
+ child_watch_data->properties->child_watch_id =
+ g_child_watch_add_full (G_PRIORITY_LOW, properties->pid,
+ xfsm_startup_child_watch, child_watch_data,
+ (GDestroyNotify) xfsm_startup_data_free);
/* set a timeout -- client must register in a a certain amount of time
* or it's assumed to be broken/have issues. */

View File

@ -1,147 +0,0 @@
From 9f3077be682355e1cd07e9a9463e76307292208c Mon Sep 17 00:00:00 2001
From: Dimitar Zhekov <hamster@mbox.contact.bg>
Date: Thu, 30 Aug 2012 20:52:14 +0000
Subject: Handle multiple interactive session save (bug #5379).
Additionnaly, we now use SmSaveGlobal on log out / shutdown without
session save which avoids data loss. Previously clients would not save
anything on log out without session save.
Based on original work by Chris Bainbridge (chris.bainbridge@gmail.com).
---
diff --git a/xfce4-session/xfsm-manager.c b/xfce4-session/xfsm-manager.c
index bf6a446..35811c5 100644
--- a/xfce4-session/xfsm-manager.c
+++ b/xfce4-session/xfsm-manager.c
@@ -98,6 +98,7 @@ struct _XfsmManager
XfsmShutdownType shutdown_type;
XfsmShutdown *shutdown_helper;
+ gboolean save_session;
gboolean session_chooser;
gchar *session_name;
@@ -230,6 +231,7 @@ xfsm_manager_init (XfsmManager *manager)
manager->failsafe_mode = TRUE;
manager->shutdown_type = XFSM_SHUTDOWN_LOGOUT;
manager->shutdown_helper = xfsm_shutdown_get ();
+ manager->save_session = TRUE;
manager->pending_properties = g_queue_new ();
manager->starting_properties = g_queue_new ();
@@ -989,7 +991,9 @@ xfsm_manager_interact (XfsmManager *manager,
XfsmClient *cl = lp->data;
if (xfsm_client_get_state (cl) == XFSM_CLIENT_INTERACTING)
{
- xfsm_client_set_state (cl, XFSM_CLIENT_WAITFORINTERACT);
+ /* a client is already interacting, so new client has to wait */
+ xfsm_client_set_state (client, XFSM_CLIENT_WAITFORINTERACT);
+ xfsm_manager_cancel_client_save_timeout(manager, client);
return;
}
}
@@ -1138,44 +1142,47 @@ xfsm_manager_save_yourself_global (XfsmManager *manager,
}
}
- if (!shutdown || shutdown_save)
+ /* don't save the session if shutting down without save */
+ manager->save_session = !shutdown || shutdown_save;
+
+ if (save_type == SmSaveBoth && !manager->save_session)
{
- xfsm_manager_set_state (manager,
- shutdown
- ? XFSM_MANAGER_SHUTDOWN
- : XFSM_MANAGER_CHECKPOINT);
+ /* saving the session, so clients should
+ * (prompt to) save the user data only */
+ save_type = SmSaveGlobal;
+ }
- /* handle legacy applications first! */
- xfsm_legacy_perform_session_save ();
+ xfsm_manager_set_state (manager,
+ shutdown
+ ? XFSM_MANAGER_SHUTDOWN
+ : XFSM_MANAGER_CHECKPOINT);
- for (lp = g_queue_peek_nth_link (manager->running_clients, 0);
- lp;
- lp = lp->next)
- {
- XfsmClient *client = lp->data;
- XfsmProperties *properties = xfsm_client_get_properties (client);
- const gchar *program;
+ /* handle legacy applications first! */
+ if (manager->save_session)
+ xfsm_legacy_perform_session_save ();
- /* xterm's session management is broken, so we won't
- * send a SAVE YOURSELF to xterms */
- program = xfsm_properties_get_string (properties, SmProgram);
- if (program != NULL && strcasecmp (program, "xterm") == 0)
- continue;
+ for (lp = g_queue_peek_nth_link (manager->running_clients, 0);
+ lp;
+ lp = lp->next)
+ {
+ XfsmClient *client = lp->data;
+ XfsmProperties *properties = xfsm_client_get_properties (client);
+ const gchar *program;
- if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL)
- {
- SmsSaveYourself (xfsm_client_get_sms_connection (client), save_type, shutdown,
- interact_style, fast);
- }
+ /* xterm's session management is broken, so we won't
+ * send a SAVE YOURSELF to xterms */
+ program = xfsm_properties_get_string (properties, SmProgram);
+ if (program != NULL && strcasecmp (program, "xterm") == 0)
+ continue;
- xfsm_client_set_state (client, XFSM_CLIENT_SAVING);
- xfsm_manager_start_client_save_timeout (manager, client);
+ if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL)
+ {
+ SmsSaveYourself (xfsm_client_get_sms_connection (client), save_type, shutdown,
+ interact_style, fast);
}
- }
- else
- {
- /* shutdown session without saving */
- xfsm_manager_perform_shutdown (manager);
+
+ xfsm_client_set_state (client, XFSM_CLIENT_SAVING);
+ xfsm_manager_start_client_save_timeout (manager, client);
}
}
@@ -1249,7 +1256,12 @@ xfsm_manager_save_yourself_done (XfsmManager *manager,
XfsmClient *client,
gboolean success)
{
- if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVING && xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL)
+ /* In xfsm_manager_interact_done we send SmsShutdownCancelled to clients in
+ XFSM_CLIENT_WAITFORINTERACT state. They respond with SmcSaveYourselfDone
+ (xsmp_shutdown_cancelled in libxfce4ui library) so we allow it here. */
+ if (xfsm_client_get_state (client) != XFSM_CLIENT_SAVING &&
+ xfsm_client_get_state (client) != XFSM_CLIENT_SAVINGLOCAL &&
+ xfsm_client_get_state (client) != XFSM_CLIENT_WAITFORINTERACT)
{
xfsm_verbose ("Client Id = %s send SAVE YOURSELF DONE, while not being "
"in save mode. Prepare to be nuked!\n",
@@ -1521,7 +1533,8 @@ xfsm_manager_complete_saveyourself (XfsmManager *manager)
xfsm_verbose ("Manager finished SAVE YOURSELF, session data will be stored now.\n\n");
/* all clients done, store session data */
- xfsm_manager_store_session (manager);
+ if (manager->save_session)
+ xfsm_manager_store_session (manager);
if (manager->state == XFSM_MANAGER_CHECKPOINT)
{
--
cgit v0.9.0.3

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Sun May 5 19:02:45 UTC 2013 - gber@opensuse.org
- update to version 4.10.1
- remove xfce environment functions and use glib
- add shutdown/reboot functionality for systemd
- fix logic of the --fast action
- bump copyright year
- store the child watch id to avoid possible double free
- use the async spawn function of glib
- autotools updates
- remove gnome-keyring remains
- handle multiple interactive session save
- translation updates
- remove obsolete xfce4-session-avoid-possible-double-free.patch,
xfce4-session-handle-multiple-interactive-session-save.patch
-------------------------------------------------------------------
Mon Apr 29 14:35:05 UTC 2013 - gber@opensuse.org

View File

@ -19,7 +19,7 @@
%define libname libxfsm-4_6-0
Name: xfce4-session
Version: 4.10.0
Version: 4.10.1
Release: 0
Summary: Xfce Session Manager
License: GPL-2.0
@ -30,10 +30,6 @@ Source0: http://archive.xfce.org/src/xfce/xfce4-session/4.10/%{name}-%{ve
Patch0: xfce4-session-simple-splash-remove-shadows.patch
# PATCH-FIX-OPENSUSE xfce4-session-adapt-session-scripts.patch bnc#789057 gber@opensuse.org -- Adapt upstream sessions script to openSUSE
Patch1: xfce4-session-adapt-session-scripts.patch
# PATCH-FIX-UPSTREAM xfce4-session-handle-multiple-interactive-session-save.patch bxo#5379 gber@opensuse.org -- Handle multiple interactive session save correctly (backported from upstream git)
Patch2: xfce4-session-handle-multiple-interactive-session-save.patch
# PATCH-FIX-UPSTREAM xfce4-session-avoid-possible-double-free.patch bxo#9709 gber@opensuse.org -- Avoid a possible double free crash (backported from upstream git)
Patch3: xfce4-session-avoid-possible-double-free.patch
%if 0%{?suse_version} > 1210
BuildRequires: iceauth
%endif
@ -50,6 +46,9 @@ BuildRequires: pkgconfig(libwnck-1.0)
BuildRequires: pkgconfig(libxfce4panel-1.0)
BuildRequires: pkgconfig(libxfce4ui-1)
BuildRequires: pkgconfig(libxfce4util-1.0)
%if 0%{?suse_version} >= 1230
BuildRequires: pkgconfig(polkit-gobject-1) >= 0.100
%endif
BuildRequires: pkgconfig(sm)
Provides: xfce-utils = %{version}
Obsoletes: xfce-utils <= 4.8.3
@ -60,7 +59,12 @@ Obsoletes: xfce-utils-lang <= 4.8.3
Provides: xfce4-session-doc = %{version}
Obsoletes: xfce4-session-doc <= 4.8.3
Requires: %{name}-branding = %{version}
%if 0%{?suse_version} < 1230
Requires: ConsoleKit-x11
%endif
%if 0%{?suse_version} >= 1230
Requires: systemd
%endif
Requires: xfce4-settings
Requires: xfconf
Recommends: %{name}-doc = %{version}
@ -113,8 +117,6 @@ This package provides the upstream look and feel for the Xfce Session Manager.
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
%configure \