public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: gnome-base/gnome-session/files/, gnome-base/gnome-session/
Date: Wed, 23 Mar 2011 21:59:21 +0000 (UTC)	[thread overview]
Message-ID: <7d5b206f2f2e51dcba43d5a9ceed3703b88353aa.nirbheek@gentoo> (raw)

commit:     7d5b206f2f2e51dcba43d5a9ceed3703b88353aa
Author:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 23 21:52:40 2011 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 21:59:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=7d5b206f

gnome-base/gnome-session: fix logout hang

https://bugzilla.gnome.org/show_bug.cgi?id=645432

---
 .../files/gnome-session-2.91.92-fix-logout.patch   |  271 ++++++++++++++++++++
 ...1.92.ebuild => gnome-session-2.91.92-r1.ebuild} |    5 +-
 2 files changed, 275 insertions(+), 1 deletions(-)

diff --git a/gnome-base/gnome-session/files/gnome-session-2.91.92-fix-logout.patch b/gnome-base/gnome-session/files/gnome-session-2.91.92-fix-logout.patch
new file mode 100644
index 0000000..35d811d
--- /dev/null
+++ b/gnome-base/gnome-session/files/gnome-session-2.91.92-fix-logout.patch
@@ -0,0 +1,271 @@
+From 1cb7101054a04b443b44b6e60928c53f2379034f Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Mon, 21 Mar 2011 14:03:55 -0400
+Subject: [PATCH] manager: port to latest shell api
+
+The shell API changed to support multiple
+buttons on the log out dialog (see bug 641375)
+
+This commit brings gnome-session up to speed.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=645432
+---
+ gnome-session/gsm-manager.c |   68 +++++++++++++++++++++++++++++++-----
+ gnome-session/gsm-shell.c   |   82 ++++++++++++++++++++++++++++++++++++------
+ gnome-session/gsm-shell.h   |    5 ++-
+ 3 files changed, 133 insertions(+), 22 deletions(-)
+
+diff --git a/gnome-session/gsm-manager.c b/gnome-session/gsm-manager.c
+index abbc223..4892c5c 100644
+--- a/gnome-session/gsm-manager.c
++++ b/gnome-session/gsm-manager.c
+@@ -149,7 +149,9 @@ struct GsmManagerPrivate
+         GsmShell               *shell;
+         guint                   shell_end_session_dialog_canceled_id;
+         guint                   shell_end_session_dialog_open_failed_id;
+-        guint                   shell_end_session_dialog_confirmed_id;
++        guint                   shell_end_session_dialog_confirmed_logout_id;
++        guint                   shell_end_session_dialog_confirmed_shutdown_id;
++        guint                   shell_end_session_dialog_confirmed_reboot_id;
+ };
+ 
+ enum {
+@@ -3058,10 +3060,22 @@ disconnect_shell_dialog_signals (GsmManager *manager)
+                 manager->priv->shell_end_session_dialog_canceled_id = 0;
+         }
+ 
+-        if (manager->priv->shell_end_session_dialog_confirmed_id != 0) {
++        if (manager->priv->shell_end_session_dialog_confirmed_logout_id != 0) {
+                 g_signal_handler_disconnect (manager->priv->shell,
+-                                             manager->priv->shell_end_session_dialog_confirmed_id);
+-                manager->priv->shell_end_session_dialog_confirmed_id = 0;
++                                             manager->priv->shell_end_session_dialog_confirmed_logout_id);
++                manager->priv->shell_end_session_dialog_confirmed_logout_id = 0;
++        }
++
++        if (manager->priv->shell_end_session_dialog_confirmed_shutdown_id != 0) {
++                g_signal_handler_disconnect (manager->priv->shell,
++                                             manager->priv->shell_end_session_dialog_confirmed_shutdown_id);
++                manager->priv->shell_end_session_dialog_confirmed_shutdown_id = 0;
++        }
++
++        if (manager->priv->shell_end_session_dialog_confirmed_reboot_id != 0) {
++                g_signal_handler_disconnect (manager->priv->shell,
++                                             manager->priv->shell_end_session_dialog_confirmed_reboot_id);
++                manager->priv->shell_end_session_dialog_confirmed_reboot_id = 0;
+         }
+ 
+         if (manager->priv->shell_end_session_dialog_open_failed_id != 0) {
+@@ -3080,8 +3094,8 @@ on_shell_end_session_dialog_canceled (GsmShell   *shell,
+ }
+ 
+ static void
+-on_shell_end_session_dialog_confirmed (GsmShell   *shell,
+-                                       GsmManager *manager)
++_handle_end_session_dialog_response (GsmManager           *manager,
++                                     GsmManagerLogoutType  logout_type)
+ {
+         /* Note we're checking for END_SESSION here and
+          * QUERY_END_SESSION in the fallback cases elsewhere.
+@@ -3098,7 +3112,31 @@ on_shell_end_session_dialog_confirmed (GsmShell   *shell,
+         }
+ 
+         manager->priv->logout_mode = GSM_MANAGER_LOGOUT_MODE_FORCE;
++        manager->priv->logout_type = logout_type;
+         end_phase (manager);
++}
++
++static void
++on_shell_end_session_dialog_confirmed_logout (GsmShell   *shell,
++                                              GsmManager *manager)
++{
++        _handle_end_session_dialog_response (manager, GSM_MANAGER_LOGOUT_LOGOUT);
++        disconnect_shell_dialog_signals (manager);
++}
++
++static void
++on_shell_end_session_dialog_confirmed_shutdown (GsmShell   *shell,
++                                                GsmManager *manager)
++{
++        _handle_end_session_dialog_response (manager, GSM_MANAGER_LOGOUT_SHUTDOWN);
++        disconnect_shell_dialog_signals (manager);
++}
++
++static void
++on_shell_end_session_dialog_confirmed_reboot (GsmShell   *shell,
++                                              GsmManager *manager)
++{
++        _handle_end_session_dialog_response (manager, GSM_MANAGER_LOGOUT_REBOOT);
+         disconnect_shell_dialog_signals (manager);
+ }
+ 
+@@ -3120,10 +3158,22 @@ connect_shell_dialog_signals (GsmManager *manager)
+                                   G_CALLBACK (on_shell_end_session_dialog_canceled),
+                                   manager);
+ 
+-        manager->priv->shell_end_session_dialog_confirmed_id =
++        manager->priv->shell_end_session_dialog_confirmed_logout_id =
++                g_signal_connect (manager->priv->shell,
++                                  "end-session-dialog-confirmed-logout",
++                                  G_CALLBACK (on_shell_end_session_dialog_confirmed_logout),
++                                  manager);
++
++        manager->priv->shell_end_session_dialog_confirmed_shutdown_id =
++                g_signal_connect (manager->priv->shell,
++                                  "end-session-dialog-confirmed-shutdown",
++                                  G_CALLBACK (on_shell_end_session_dialog_confirmed_shutdown),
++                                  manager);
++
++        manager->priv->shell_end_session_dialog_confirmed_reboot_id =
+                 g_signal_connect (manager->priv->shell,
+-                                  "end-session-dialog-confirmed",
+-                                  G_CALLBACK (on_shell_end_session_dialog_confirmed),
++                                  "end-session-dialog-confirmed-reboot",
++                                  G_CALLBACK (on_shell_end_session_dialog_confirmed_reboot),
+                                   manager);
+ }
+ 
+diff --git a/gnome-session/gsm-shell.c b/gnome-session/gsm-shell.c
+index fb5f4ed..be234aa 100644
+--- a/gnome-session/gsm-shell.c
++++ b/gnome-session/gsm-shell.c
+@@ -74,7 +74,9 @@ enum {
+         END_SESSION_DIALOG_OPENED = 0,
+         END_SESSION_DIALOG_OPEN_FAILED,
+         END_SESSION_DIALOG_CANCELED,
+-        END_SESSION_DIALOG_CONFIRMED,
++        END_SESSION_DIALOG_CONFIRMED_LOGOUT,
++        END_SESSION_DIALOG_CONFIRMED_SHUTDOWN,
++        END_SESSION_DIALOG_CONFIRMED_REBOOT,
+         NUMBER_OF_SIGNALS
+ };
+ 
+@@ -169,11 +171,31 @@ gsm_shell_class_init (GsmShellClass *shell_class)
+                               g_cclosure_marshal_VOID__VOID,
+                               G_TYPE_NONE, 0);
+ 
+-        signals [END_SESSION_DIALOG_CONFIRMED] =
+-                g_signal_new ("end-session-dialog-confirmed",
++        signals [END_SESSION_DIALOG_CONFIRMED_LOGOUT] =
++                g_signal_new ("end-session-dialog-confirmed-logout",
+                               G_OBJECT_CLASS_TYPE (object_class),
+                               G_SIGNAL_RUN_LAST,
+-                              G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed),
++                              G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_logout),
++                              NULL,
++                              NULL,
++                              g_cclosure_marshal_VOID__VOID,
++                              G_TYPE_NONE, 0);
++
++        signals [END_SESSION_DIALOG_CONFIRMED_SHUTDOWN] =
++                g_signal_new ("end-session-dialog-confirmed-shutdown",
++                              G_OBJECT_CLASS_TYPE (object_class),
++                              G_SIGNAL_RUN_LAST,
++                              G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_shutdown),
++                              NULL,
++                              NULL,
++                              g_cclosure_marshal_VOID__VOID,
++                              G_TYPE_NONE, 0);
++
++        signals [END_SESSION_DIALOG_CONFIRMED_REBOOT] =
++                g_signal_new ("end-session-dialog-confirmed-reboot",
++                              G_OBJECT_CLASS_TYPE (object_class),
++                              G_SIGNAL_RUN_LAST,
++                              G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_reboot),
+                               NULL,
+                               NULL,
+                               g_cclosure_marshal_VOID__VOID,
+@@ -477,8 +499,21 @@ on_end_session_dialog_canceled (DBusGProxy *proxy,
+ }
+ 
+ static void
+-on_end_session_dialog_confirmed (DBusGProxy *proxy,
+-                                 GsmShell   *shell)
++on_end_session_dialog_confirmed_logout (DBusGProxy *proxy,
++                                        GsmShell   *shell)
++{
++        if (shell->priv->update_idle_id != 0) {
++                g_source_remove (shell->priv->update_idle_id);
++                shell->priv->update_idle_id = 0;
++        }
++
++        shell->priv->has_open_dialog = FALSE;
++        g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_LOGOUT], 0);
++}
++
++static void
++on_end_session_dialog_confirmed_shutdown (DBusGProxy *proxy,
++                                          GsmShell   *shell)
+ {
+         if (shell->priv->update_idle_id != 0) {
+                 g_source_remove (shell->priv->update_idle_id);
+@@ -486,7 +521,20 @@ on_end_session_dialog_confirmed (DBusGProxy *proxy,
+         }
+ 
+         shell->priv->has_open_dialog = FALSE;
+-        g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED], 0);
++        g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_SHUTDOWN], 0);
++}
++
++static void
++on_end_session_dialog_confirmed_reboot (DBusGProxy *proxy,
++                                        GsmShell   *shell)
++{
++        if (shell->priv->update_idle_id != 0) {
++                g_source_remove (shell->priv->update_idle_id);
++                shell->priv->update_idle_id = 0;
++        }
++
++        shell->priv->has_open_dialog = FALSE;
++        g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_REBOOT], 0);
+ }
+ 
+ static void
+@@ -575,14 +623,24 @@ gsm_shell_open_end_session_dialog (GsmShell *shell,
+                                              "Canceled",
+                                              G_CALLBACK (on_end_session_dialog_canceled),
+                                              shell, NULL);
+-
+                 dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
+-                                         "Confirmed", G_TYPE_INVALID);
++                                         "ConfirmedLogout", G_TYPE_INVALID);
+                 dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
+-                                             "Confirmed",
+-                                             G_CALLBACK (on_end_session_dialog_confirmed),
++                                             "ConfirmedLogout",
++                                             G_CALLBACK (on_end_session_dialog_confirmed_logout),
++                                             shell, NULL);
++                dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
++                                         "ConfirmedShutdown", G_TYPE_INVALID);
++                dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
++                                             "ConfirmedShutdown",
++                                             G_CALLBACK (on_end_session_dialog_confirmed_shutdown),
++                                             shell, NULL);
++                dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
++                                         "ConfirmedReboot", G_TYPE_INVALID);
++                dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
++                                             "ConfirmedReboot",
++                                             G_CALLBACK (on_end_session_dialog_confirmed_reboot),
+                                              shell, NULL);
+-
+         }
+ 
+         inhibitor_array = get_array_from_store (inhibitors);
+diff --git a/gnome-session/gsm-shell.h b/gnome-session/gsm-shell.h
+index 74a617d..123d4cc 100644
+--- a/gnome-session/gsm-shell.h
++++ b/gnome-session/gsm-shell.h
+@@ -64,7 +64,10 @@ struct _GsmShellClass
+         void (* end_session_dialog_opened)        (GsmShell *shell);
+         void (* end_session_dialog_open_failed)   (GsmShell *shell);
+         void (* end_session_dialog_canceled)      (GsmShell *shell);
+-        void (* end_session_dialog_confirmed)     (GsmShell *shell);
++
++        void (* end_session_dialog_confirmed_logout)   (GsmShell *shell);
++        void (* end_session_dialog_confirmed_shutdown) (GsmShell *shell);
++        void (* end_session_dialog_confirmed_reboot)   (GsmShell *shell);
+ 
+ };
+ 
+-- 
+1.7.4.1
\ No newline at end of file

diff --git a/gnome-base/gnome-session/gnome-session-2.91.92.ebuild b/gnome-base/gnome-session/gnome-session-2.91.92-r1.ebuild
similarity index 95%
rename from gnome-base/gnome-session/gnome-session-2.91.92.ebuild
rename to gnome-base/gnome-session/gnome-session-2.91.92-r1.ebuild
index 177516d..df7fdaa 100644
--- a/gnome-base/gnome-session/gnome-session-2.91.92.ebuild
+++ b/gnome-base/gnome-session/gnome-session-2.91.92-r1.ebuild
@@ -5,7 +5,7 @@
 EAPI="3"
 GCONF_DEBUG="yes"
 
-inherit gnome2
+inherit eutils gnome2
 
 DESCRIPTION="Gnome session manager"
 HOMEPAGE="http://www.gnome.org/"
@@ -73,6 +73,9 @@ src_prepare() {
 		$(use_enable ipv6)"
 	DOCS="AUTHORS ChangeLog NEWS README"
 
+	# Fixed upstream, https://bugzilla.gnome.org/show_bug.cgi?id=645432
+	epatch "${FILESDIR}/${P}-fix-logout.patch"
+
 	gnome2_src_prepare
 }
 



             reply	other threads:[~2011-03-23 21:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 21:59 Nirbheek Chauhan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-28 17:59 [gentoo-commits] proj/gnome:master commit in: gnome-base/gnome-session/files/, gnome-base/gnome-session/ Mart Raudsepp
2014-04-20 18:17 Gilles Dartiguelongue
2013-12-12 23:20 Gilles Dartiguelongue
2013-02-06  3:32 Alexandre Rostovtsev
2012-03-27  6:18 Alexandre Restovtsev
2011-04-08 10:52 Gilles Dartiguelongue
2011-03-23 22:07 Nirbheek Chauhan
2011-03-05 19:59 Nirbheek Chauhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d5b206f2f2e51dcba43d5a9ceed3703b88353aa.nirbheek@gentoo \
    --to=nirbheek@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox