From owner-svn-ports-all@FreeBSD.ORG Sun Mar 3 16:08:48 2013 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C92498C8; Sun, 3 Mar 2013 16:08:48 +0000 (UTC) (envelope-from olivierd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB4E6DF3; Sun, 3 Mar 2013 16:08:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r23G8maP094701; Sun, 3 Mar 2013 16:08:48 GMT (envelope-from olivierd@svn.freebsd.org) Received: (from olivierd@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r23G8lqD094696; Sun, 3 Mar 2013 16:08:47 GMT (envelope-from olivierd@svn.freebsd.org) Message-Id: <201303031608.r23G8lqD094696@svn.freebsd.org> From: Olivier Duchateau Date: Sun, 3 Mar 2013 16:08:47 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r313364 - in head/x11-wm: xfce4-panel xfce4-panel/files xfce4-session xfce4-session/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 16:08:49 -0000 Author: olivierd Date: Sun Mar 3 16:08:46 2013 New Revision: 313364 URL: http://svnweb.freebsd.org/changeset/ports/313364 Log: - Avoid coredump when we try to save session PR: 170825 Submitted by: Greg Becker Approved by: rene, miwi (mentors, implicit) Obtained from: project repository Added: head/x11-wm/xfce4-panel/files/ head/x11-wm/xfce4-panel/files/patch-plugins__actions__actions.c (contents, props changed) head/x11-wm/xfce4-session/files/patch-xfce4-session-logout__main.c (contents, props changed) head/x11-wm/xfce4-session/files/patch-xfce4-session__xfsm-manager.c (contents, props changed) Modified: head/x11-wm/xfce4-panel/Makefile head/x11-wm/xfce4-session/Makefile (contents, props changed) Modified: head/x11-wm/xfce4-panel/Makefile ============================================================================== --- head/x11-wm/xfce4-panel/Makefile Sun Mar 3 15:55:04 2013 (r313363) +++ head/x11-wm/xfce4-panel/Makefile Sun Mar 3 16:08:46 2013 (r313364) @@ -4,7 +4,7 @@ PORTNAME= xfce4-panel PORTVERSION= 4.10.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= x11-wm xfce MASTER_SITES= ${MASTER_SITE_XFCE} DIST_SUBDIR= xfce4 Added: head/x11-wm/xfce4-panel/files/patch-plugins__actions__actions.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-wm/xfce4-panel/files/patch-plugins__actions__actions.c Sun Mar 3 16:08:46 2013 (r313364) @@ -0,0 +1,38 @@ +--- ./plugins/actions/actions.c.orig 2012-04-28 20:31:35.000000000 +0000 ++++ ./plugins/actions/actions.c 2013-02-18 19:39:14.000000000 +0000 +@@ -705,7 +705,7 @@ + + if (timeout->time_left == 0) + { +- /* unattended shutdown, so don't allow apps to cancel shutdown */ ++ /* unattended shutdown, don't save the session to avoid blocking the logout */ + timeout->unattended = TRUE; + + gtk_dialog_response (GTK_DIALOG (timeout->dialog), +@@ -928,22 +928,22 @@ + { + case ACTION_TYPE_LOGOUT: + succeed = actions_plugin_action_dbus_xfsm ("Logout", FALSE, +- unattended, &error); ++ !unattended, &error); + break; + + case ACTION_TYPE_LOGOUT_DIALOG: + succeed = actions_plugin_action_dbus_xfsm ("Logout", TRUE, +- unattended, &error); ++ !unattended, &error); + break; + + case ACTION_TYPE_RESTART: + succeed = actions_plugin_action_dbus_xfsm ("Restart", FALSE, +- unattended, &error); ++ !unattended, &error); + break; + + case ACTION_TYPE_SHUTDOWN: + succeed = actions_plugin_action_dbus_xfsm ("Shutdown", FALSE, +- unattended, &error); ++ !unattended, &error); + break; + + case ACTION_TYPE_HIBERNATE: Modified: head/x11-wm/xfce4-session/Makefile ============================================================================== --- head/x11-wm/xfce4-session/Makefile Sun Mar 3 15:55:04 2013 (r313363) +++ head/x11-wm/xfce4-session/Makefile Sun Mar 3 16:08:46 2013 (r313364) @@ -1,13 +1,10 @@ -# New ports collection makefile for: xfce4-session -# Date created: 2003-10-30 -# Whom: Matt Lancereau -# +# Created by: Matt Lancereau # $FreeBSD$ # PORTNAME= xfce4-session PORTVERSION= 4.10.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11-wm xfce MASTER_SITES= ${MASTER_SITE_XFCE} DIST_SUBDIR= xfce4 @@ -15,22 +12,21 @@ DIST_SUBDIR= xfce4 MAINTAINER= xfce@FreeBSD.org COMMENT= Xfce's session manager -#CONFLICTS= xfce4-utils-4.8.* - BUILD_DEPENDS= iceauth:${PORTSDIR}/x11/iceauth RUN_DEPENDS= iceauth:${PORTSDIR}/x11/iceauth \ console-kit-daemon:${PORTSDIR}/sysutils/consolekit -LIB_DEPENDS= wnck-1.22:${PORTSDIR}/x11-toolkits/libwnck \ - dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \ - upower-glib.1:${PORTSDIR}/sysutils/upower \ - polkit.2:${PORTSDIR}/sysutils/policykit +LIB_DEPENDS= wnck-1:${PORTSDIR}/x11-toolkits/libwnck \ + dbus-glib-1:${PORTSDIR}/devel/dbus-glib \ + upower-glib:${PORTSDIR}/sysutils/upower \ + polkit:${PORTSDIR}/sysutils/policykit USE_AUTOTOOLS= libtool GNU_CONFIGURE= yes INSTALLS_ICONS= yes USE_BZIP2= yes USE_GMAKE= yes -USE_GNOME= gnomehack gtk20 glib20 intltool intlhack pkgconfig desktopfileutils +USE_GNOME= gnomehack gtk20 glib20 intltool intlhack desktopfileutils +USE_PKGCONFIG= build USE_LDCONFIG= yes USE_XFCE= configenv libmenu libutil panel xfconf USE_XORG= x11 sm ice @@ -44,12 +40,12 @@ PKGMESSAGE= ${WRKDIR}/pkg-message OPTIONS_DEFINE= NLS GNUPG -.include - MAN1= xfce4-session.1 xfce4-session-logout.1 PLIST_SUB= VERSION="4.6" +.include + .if ${PORT_OPTIONS:MNLS} USE_GETTEXT= yes CONFIGURE_ARGS+= --enable-nls Added: head/x11-wm/xfce4-session/files/patch-xfce4-session-logout__main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-wm/xfce4-session/files/patch-xfce4-session-logout__main.c Sun Mar 3 16:08:46 2013 (r313364) @@ -0,0 +1,38 @@ +--- ./xfce4-session-logout/main.c.orig 2012-04-28 20:43:27.000000000 +0000 ++++ ./xfce4-session-logout/main.c 2013-02-18 19:18:45.000000000 +0000 +@@ -48,7 +48,7 @@ + gboolean opt_reboot = FALSE; + gboolean opt_suspend = FALSE; + gboolean opt_hibernate = FALSE; +-gboolean allow_save = FALSE; ++gboolean opt_fast = FALSE; + gboolean opt_version = FALSE; + + enum +@@ -83,7 +83,7 @@ + N_("Hibernate without displaying the logout dialog"), + NULL + }, +- { "fast", 'f', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &allow_save, ++ { "fast", 'f', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &opt_fast, + N_("Log out quickly; don't save the session"), + NULL + }, +@@ -123,6 +123,7 @@ + gboolean show_dialog; + gboolean result = FALSE; + guint shutdown_type; ++ gboolean allow_save; + + xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8"); + +@@ -149,6 +150,9 @@ + return EXIT_FAILURE; + } + ++ /* save the session, unless fast is provided */ ++ allow_save = !opt_fast; ++ + /* create messsage */ + proxy = dbus_g_proxy_new_for_name_owner (conn, + "org.xfce.SessionManager", Added: head/x11-wm/xfce4-session/files/patch-xfce4-session__xfsm-manager.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-wm/xfce4-session/files/patch-xfce4-session__xfsm-manager.c Sun Mar 3 16:08:46 2013 (r313364) @@ -0,0 +1,132 @@ +--- ./xfce4-session/xfsm-manager.c.orig 2012-04-28 20:43:27.000000000 +0000 ++++ ./xfce4-session/xfsm-manager.c 2013-02-18 19:14:56.000000000 +0000 +@@ -98,6 +98,7 @@ + + XfsmShutdownType shutdown_type; + XfsmShutdown *shutdown_helper; ++ gboolean save_session; + + gboolean session_chooser; + gchar *session_name; +@@ -230,6 +231,7 @@ + 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 @@ + 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 @@ + } + } + +- 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 @@ + 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_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) + {