Merge lp:~jamesodhunt/ubuntu/trusty/gnome-session/bug-1256262 into lp:ubuntu/trusty/gnome-session

Proposed by James Hunt
Status: Merged
Merge reported by: Dimitri John Ledkov
Merged at revision: not available
Proposed branch: lp:~jamesodhunt/ubuntu/trusty/gnome-session/bug-1256262
Merge into: lp:ubuntu/trusty/gnome-session
Diff against target: 809 lines (+10/-762)
5 files modified
.pc/103_kill_the_fail_whale.patch/gnome-session/gsm-fail-whale.c (+0/-47)
.pc/13_display_session_properties.patch/data/session-properties.desktop.in.in (+0/-15)
.pc/git_fix_wrong_unref_call.patch/gnome-session/gsm-shell.c (+0/-700)
debian/changelog (+7/-0)
debian/gnome-session.user-session.upstart (+3/-0)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/trusty/gnome-session/bug-1256262
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Approve
Review via email: mp+197663@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

"Merged" into lp:~ubuntu-desktop/gnome-session/ubuntu sans quilt brain-deadness =)

ANd uploaded.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file '.pc/103_kill_the_fail_whale.patch/gnome-session/gsm-fail-whale.c'
2--- .pc/103_kill_the_fail_whale.patch/gnome-session/gsm-fail-whale.c 2013-06-19 10:37:29 +0000
3+++ .pc/103_kill_the_fail_whale.patch/gnome-session/gsm-fail-whale.c 1970-01-01 00:00:00 +0000
4@@ -1,47 +0,0 @@
5-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
6- * gsm-fail-whale.c
7- * Copyright (C) 2012 Red Hat, Inc
8- *
9- * This program is free software; you can redistribute it and/or
10- * modify it under the terms of the GNU General Public License as
11- * published by the Free Software Foundation; either version 2 of the
12- * License, or (at your option) any later version.
13- *
14- * This program is distributed in the hope that it will be useful, but
15- * WITHOUT ANY WARRANTY; without even the implied warranty of
16- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17- * Lesser General Public License for more details.
18- *
19- * You should have received a copy of the GNU General Public License
20- * along with this program; if not, write to the Free Software
21- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22- * 02111-1307, USA.
23- */
24-
25-#include <config.h>
26-
27-#include <glib/gi18n.h>
28-#include <glib/gstdio.h>
29-
30-#include "gsm-fail-whale.h"
31-
32-void
33-gsm_fail_whale_dialog_we_failed (gboolean debug_mode,
34- gboolean allow_logout,
35- GsmShellExtensions *extensions)
36-{
37- gint i;
38- gchar *argv[5];
39-
40- i = 0;
41- argv[i++] = LIBEXECDIR "/gnome-session-failed";
42- if (debug_mode)
43- argv[i++] = "--debug";
44- if (allow_logout)
45- argv[i++] = "--allow-logout";
46- if (extensions != NULL && gsm_shell_extensions_n_extensions (extensions) > 0)
47- argv[i++] = "--extensions";
48- argv[i++] = NULL;
49-
50- g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL);
51-}
52
53=== removed directory '.pc/13_display_session_properties.patch'
54=== removed directory '.pc/13_display_session_properties.patch/data'
55=== removed file '.pc/13_display_session_properties.patch/data/session-properties.desktop.in.in'
56--- .pc/13_display_session_properties.patch/data/session-properties.desktop.in.in 2012-09-05 00:53:57 +0000
57+++ .pc/13_display_session_properties.patch/data/session-properties.desktop.in.in 1970-01-01 00:00:00 +0000
58@@ -1,15 +0,0 @@
59-[Desktop Entry]
60-_Name=Startup Applications
61-_Comment=Choose what applications to start when you log in
62-Exec=gnome-session-properties
63-Icon=session-properties
64-Terminal=false
65-Type=Application
66-StartupNotify=true
67-Categories=GTK;GNOME;Settings;X-GNOME-PersonalSettings;
68-OnlyShowIn=GNOME;Unity;
69-NoDisplay=true
70-X-GNOME-Bugzilla-Bugzilla=GNOME
71-X-GNOME-Bugzilla-Product=gnome-session
72-X-GNOME-Bugzilla-Component=gnome-session-properties
73-X-GNOME-Bugzilla-Version=@VERSION@
74
75=== removed directory '.pc/git_fix_wrong_unref_call.patch'
76=== removed directory '.pc/git_fix_wrong_unref_call.patch/gnome-session'
77=== removed file '.pc/git_fix_wrong_unref_call.patch/gnome-session/gsm-shell.c'
78--- .pc/git_fix_wrong_unref_call.patch/gnome-session/gsm-shell.c 2013-10-11 15:45:25 +0000
79+++ .pc/git_fix_wrong_unref_call.patch/gnome-session/gsm-shell.c 1970-01-01 00:00:00 +0000
80@@ -1,700 +0,0 @@
81-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
82- *
83- * Copyright (C) 2010 Red Hat, Inc
84- *
85- * This program is free software; you can redistribute it and/or modify
86- * it under the terms of the GNU General Public License as published by
87- * the Free Software Foundation; either version 2, or (at your option)
88- * any later version.
89- *
90- * This program is distributed in the hope that it will be useful,
91- * but WITHOUT ANY WARRANTY; without even the implied warranty of
92- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
93- * GNU General Public License for more details.
94- *
95- * You should have received a copy of the GNU General Public License
96- * along with this program; if not, write to the Free Software
97- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
98- * 02111-1307, USA.
99- */
100-
101-#include "config.h"
102-
103-#include <errno.h>
104-#include <string.h>
105-#include <unistd.h>
106-
107-#include <glib.h>
108-#include <glib-object.h>
109-#include <glib/gi18n.h>
110-
111-#include <dbus/dbus-glib.h>
112-#include <dbus/dbus-glib-lowlevel.h>
113-
114-#include "gsm-inhibitor.h"
115-#include "gsm-shell.h"
116-
117-#define SHELL_NAME "org.gnome.Shell"
118-#define SHELL_PATH "/org/gnome/Shell"
119-#define SHELL_INTERFACE "org.gnome.Shell"
120-
121-#define SHELL_END_SESSION_DIALOG_PATH "/org/gnome/SessionManager/EndSessionDialog"
122-#define SHELL_END_SESSION_DIALOG_INTERFACE "org.gnome.SessionManager.EndSessionDialog"
123-
124-#define GSM_SHELL_DBUS_TYPE_G_OBJECT_PATH_ARRAY (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH))
125-
126-#define AUTOMATIC_ACTION_TIMEOUT 60
127-
128-#define GSM_SHELL_GET_PRIVATE(o) \
129- (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSM_TYPE_SHELL, GsmShellPrivate))
130-
131-struct _GsmShellPrivate
132-{
133- DBusGConnection *bus_connection;
134- DBusGProxy *bus_proxy;
135- DBusGProxy *proxy;
136- DBusGProxy *end_session_dialog_proxy;
137- GsmStore *inhibitors;
138-
139- guint32 is_running : 1;
140-
141- DBusGProxyCall *end_session_open_call;
142- GsmShellEndSessionDialogType end_session_dialog_type;
143-
144- guint update_idle_id;
145-};
146-
147-enum {
148- PROP_0,
149- PROP_IS_RUNNING
150-};
151-
152-enum {
153- END_SESSION_DIALOG_OPENED = 0,
154- END_SESSION_DIALOG_OPEN_FAILED,
155- END_SESSION_DIALOG_CLOSED,
156- END_SESSION_DIALOG_CANCELED,
157- END_SESSION_DIALOG_CONFIRMED_LOGOUT,
158- END_SESSION_DIALOG_CONFIRMED_SHUTDOWN,
159- END_SESSION_DIALOG_CONFIRMED_REBOOT,
160- NUMBER_OF_SIGNALS
161-};
162-
163-static guint signals[NUMBER_OF_SIGNALS] = { 0 };
164-
165-static void gsm_shell_class_init (GsmShellClass *klass);
166-static void gsm_shell_init (GsmShell *ck);
167-static void gsm_shell_finalize (GObject *object);
168-
169-static void gsm_shell_disconnect_from_bus (GsmShell *shell);
170-
171-static DBusHandlerResult gsm_shell_bus_filter (DBusConnection *connection,
172- DBusMessage *message,
173- void *user_data);
174-
175-static void gsm_shell_on_name_owner_changed (DBusGProxy *bus_proxy,
176- const char *name,
177- const char *prev_owner,
178- const char *new_owner,
179- GsmShell *shell);
180-static void queue_end_session_dialog_update (GsmShell *shell);
181-
182-G_DEFINE_TYPE (GsmShell, gsm_shell, G_TYPE_OBJECT);
183-
184-static void
185-gsm_shell_get_property (GObject *object,
186- guint prop_id,
187- GValue *value,
188- GParamSpec *pspec)
189-{
190- GsmShell *shell = GSM_SHELL (object);
191-
192- switch (prop_id) {
193- case PROP_IS_RUNNING:
194- g_value_set_boolean (value,
195- shell->priv->is_running);
196- break;
197-
198- default:
199- G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
200- prop_id,
201- pspec);
202- }
203-}
204-
205-static void
206-gsm_shell_class_init (GsmShellClass *shell_class)
207-{
208- GObjectClass *object_class;
209- GParamSpec *param_spec;
210-
211- object_class = G_OBJECT_CLASS (shell_class);
212-
213- object_class->finalize = gsm_shell_finalize;
214- object_class->get_property = gsm_shell_get_property;
215-
216- param_spec = g_param_spec_boolean ("is-running",
217- "Is running",
218- "Whether GNOME Shell is running in the session",
219- FALSE,
220- G_PARAM_READABLE);
221-
222- g_object_class_install_property (object_class, PROP_IS_RUNNING,
223- param_spec);
224-
225- signals [END_SESSION_DIALOG_OPENED] =
226- g_signal_new ("end-session-dialog-opened",
227- G_OBJECT_CLASS_TYPE (object_class),
228- G_SIGNAL_RUN_LAST,
229- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_opened),
230- NULL, NULL, NULL,
231- G_TYPE_NONE, 0);
232-
233- signals [END_SESSION_DIALOG_OPEN_FAILED] =
234- g_signal_new ("end-session-dialog-open-failed",
235- G_OBJECT_CLASS_TYPE (object_class),
236- G_SIGNAL_RUN_LAST,
237- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_open_failed),
238- NULL, NULL, NULL,
239- G_TYPE_NONE, 0);
240-
241- signals [END_SESSION_DIALOG_CLOSED] =
242- g_signal_new ("end-session-dialog-closed",
243- G_OBJECT_CLASS_TYPE (object_class),
244- G_SIGNAL_RUN_LAST,
245- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_closed),
246- NULL, NULL, NULL,
247- G_TYPE_NONE, 0);
248-
249- signals [END_SESSION_DIALOG_CANCELED] =
250- g_signal_new ("end-session-dialog-canceled",
251- G_OBJECT_CLASS_TYPE (object_class),
252- G_SIGNAL_RUN_LAST,
253- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_canceled),
254- NULL, NULL, NULL,
255- G_TYPE_NONE, 0);
256-
257- signals [END_SESSION_DIALOG_CONFIRMED_LOGOUT] =
258- g_signal_new ("end-session-dialog-confirmed-logout",
259- G_OBJECT_CLASS_TYPE (object_class),
260- G_SIGNAL_RUN_LAST,
261- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_logout),
262- NULL, NULL, NULL,
263- G_TYPE_NONE, 0);
264-
265- signals [END_SESSION_DIALOG_CONFIRMED_SHUTDOWN] =
266- g_signal_new ("end-session-dialog-confirmed-shutdown",
267- G_OBJECT_CLASS_TYPE (object_class),
268- G_SIGNAL_RUN_LAST,
269- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_shutdown),
270- NULL, NULL, NULL,
271- G_TYPE_NONE, 0);
272-
273- signals [END_SESSION_DIALOG_CONFIRMED_REBOOT] =
274- g_signal_new ("end-session-dialog-confirmed-reboot",
275- G_OBJECT_CLASS_TYPE (object_class),
276- G_SIGNAL_RUN_LAST,
277- G_STRUCT_OFFSET (GsmShellClass, end_session_dialog_confirmed_reboot),
278- NULL, NULL, NULL,
279- G_TYPE_NONE, 0);
280-
281- g_type_class_add_private (shell_class, sizeof (GsmShellPrivate));
282-}
283-
284-static DBusHandlerResult
285-gsm_shell_bus_filter (DBusConnection *connection,
286- DBusMessage *message,
287- void *user_data)
288-{
289- GsmShell *shell;
290-
291- shell = GSM_SHELL (user_data);
292-
293- if (dbus_message_is_signal (message,
294- DBUS_INTERFACE_LOCAL, "Disconnected") &&
295- strcmp (dbus_message_get_path (message), DBUS_PATH_LOCAL) == 0) {
296- gsm_shell_disconnect_from_bus (shell);
297- /* let other filters get this disconnected signal, so that they
298- * can handle it too */
299- }
300-
301- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
302-}
303-
304-static gboolean
305-gsm_shell_ensure_connection (GsmShell *shell,
306- GError **error)
307-{
308- GError *connection_error;
309- gboolean is_running;
310-
311- connection_error = NULL;
312-
313- if (shell->priv->bus_connection == NULL) {
314- DBusConnection *connection;
315-
316- shell->priv->bus_connection = dbus_g_bus_get (DBUS_BUS_SESSION,
317- &connection_error);
318-
319- if (shell->priv->bus_connection == NULL) {
320- g_propagate_error (error, connection_error);
321- is_running = FALSE;
322- goto out;
323- }
324-
325- connection = dbus_g_connection_get_connection (shell->priv->bus_connection);
326- dbus_connection_set_exit_on_disconnect (connection, FALSE);
327- dbus_connection_add_filter (connection,
328- gsm_shell_bus_filter,
329- shell, NULL);
330- }
331-
332- if (shell->priv->bus_proxy == NULL) {
333- shell->priv->bus_proxy =
334- dbus_g_proxy_new_for_name_owner (shell->priv->bus_connection,
335- DBUS_SERVICE_DBUS,
336- DBUS_PATH_DBUS,
337- DBUS_INTERFACE_DBUS,
338- &connection_error);
339-
340- if (shell->priv->bus_proxy == NULL) {
341- g_propagate_error (error, connection_error);
342- is_running = FALSE;
343- goto out;
344- }
345-
346- dbus_g_proxy_add_signal (shell->priv->bus_proxy,
347- "NameOwnerChanged",
348- G_TYPE_STRING,
349- G_TYPE_STRING,
350- G_TYPE_STRING,
351- G_TYPE_INVALID);
352-
353- dbus_g_proxy_connect_signal (shell->priv->bus_proxy,
354- "NameOwnerChanged",
355- G_CALLBACK (gsm_shell_on_name_owner_changed),
356- shell, NULL);
357- }
358-
359- if (shell->priv->proxy == NULL) {
360- shell->priv->proxy =
361- dbus_g_proxy_new_for_name_owner (shell->priv->bus_connection,
362- SHELL_NAME,
363- SHELL_PATH,
364- SHELL_INTERFACE,
365- &connection_error);
366-
367- if (shell->priv->proxy == NULL) {
368- g_propagate_error (error, connection_error);
369- is_running = FALSE;
370- goto out;
371- }
372- }
373-
374- g_debug ("GsmShell: Connected to the shell");
375-
376- is_running = TRUE;
377-
378- out:
379- if (shell->priv->is_running != is_running) {
380- shell->priv->is_running = is_running;
381- g_object_notify (G_OBJECT (shell), "is-running");
382- }
383-
384- if (!is_running) {
385- g_debug ("GsmShell: Not connected to the shell");
386-
387- if (shell->priv->bus_connection == NULL) {
388- g_clear_object (&shell->priv->bus_proxy);
389- g_clear_object (&shell->priv->proxy);
390- } else if (shell->priv->bus_proxy == NULL) {
391- g_clear_object (&shell->priv->proxy);
392- }
393- }
394-
395- return is_running;
396-}
397-
398-static void
399-gsm_shell_on_name_owner_changed (DBusGProxy *bus_proxy,
400- const char *name,
401- const char *prev_owner,
402- const char *new_owner,
403- GsmShell *shell)
404-{
405- if (name != NULL && strcmp (name, SHELL_NAME) != 0) {
406- return;
407- }
408-
409- g_clear_object (&shell->priv->proxy);
410-
411- gsm_shell_ensure_connection (shell, NULL);
412-}
413-
414-static void
415-gsm_shell_init (GsmShell *shell)
416-{
417- shell->priv = GSM_SHELL_GET_PRIVATE (shell);
418-
419- gsm_shell_ensure_connection (shell, NULL);
420-}
421-
422-static void
423-gsm_shell_disconnect_from_bus (GsmShell *shell)
424-{
425- g_clear_object (&shell->priv->bus_proxy);
426- g_clear_object (&shell->priv->proxy);
427-
428- if (shell->priv->bus_connection != NULL) {
429- DBusConnection *connection;
430- connection = dbus_g_connection_get_connection (shell->priv->bus_connection);
431- dbus_connection_remove_filter (connection,
432- gsm_shell_bus_filter,
433- shell);
434-
435- dbus_g_connection_unref (shell->priv->bus_connection);
436- shell->priv->bus_connection = NULL;
437- }
438-}
439-
440-static void
441-gsm_shell_finalize (GObject *object)
442-{
443- GsmShell *shell;
444- GObjectClass *parent_class;
445-
446- shell = GSM_SHELL (object);
447-
448- parent_class = G_OBJECT_CLASS (gsm_shell_parent_class);
449-
450- g_object_unref (shell->priv->inhibitors);
451-
452- gsm_shell_disconnect_from_bus (shell);
453-
454- if (parent_class->finalize != NULL) {
455- parent_class->finalize (object);
456- }
457-}
458-
459-GsmShell *
460-gsm_shell_new (void)
461-{
462- GsmShell *shell;
463-
464- shell = g_object_new (GSM_TYPE_SHELL, NULL);
465-
466- return shell;
467-}
468-
469-GsmShell *
470-gsm_get_shell (void)
471-{
472- static GsmShell *shell = NULL;
473-
474- if (shell == NULL) {
475- shell = gsm_shell_new ();
476- }
477-
478- return g_object_ref (shell);
479-}
480-
481-gboolean
482-gsm_shell_is_running (GsmShell *shell)
483-{
484- gsm_shell_ensure_connection (shell, NULL);
485-
486- return shell->priv->is_running;
487-}
488-
489-static gboolean
490-add_inhibitor_to_array (const char *id,
491- GsmInhibitor *inhibitor,
492- GPtrArray *array)
493-{
494-
495- g_ptr_array_add (array,
496- g_strdup (gsm_inhibitor_peek_id (inhibitor)));
497- return FALSE;
498-}
499-
500-static GPtrArray *
501-get_array_from_store (GsmStore *inhibitors)
502-{
503- GPtrArray *array;
504-
505- array = g_ptr_array_new ();
506-
507- gsm_store_foreach (inhibitors,
508- (GsmStoreFunc) add_inhibitor_to_array,
509- array);
510-
511- return array;
512-}
513-
514-static void
515-on_open_finished (DBusGProxy *proxy,
516- DBusGProxyCall *call,
517- GsmShell *shell)
518-{
519- GError *error;
520- gboolean res;
521-
522- g_assert (shell->priv->end_session_open_call == call);
523-
524- error = NULL;
525- res = dbus_g_proxy_end_call (proxy,
526- call,
527- &error,
528- G_TYPE_INVALID);
529- shell->priv->end_session_open_call = NULL;
530-
531- if (shell->priv->update_idle_id != 0) {
532- g_source_remove (shell->priv->update_idle_id);
533- shell->priv->update_idle_id = 0;
534- }
535-
536- if (!res) {
537- g_warning ("Unable to open shell end session dialog");
538- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_OPEN_FAILED], 0);
539- return;
540- }
541-
542- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_OPENED], 0);
543-}
544-
545-static void
546-on_end_session_dialog_closed (DBusGProxy *proxy,
547- GsmShell *shell)
548-{
549- if (shell->priv->update_idle_id != 0) {
550- g_source_remove (shell->priv->update_idle_id);
551- shell->priv->update_idle_id = 0;
552- }
553-
554- g_signal_handlers_disconnect_by_func (shell->priv->inhibitors,
555- G_CALLBACK (queue_end_session_dialog_update),
556- shell);
557-
558- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CLOSED], 0);
559-}
560-
561-static void
562-on_end_session_dialog_canceled (DBusGProxy *proxy,
563- GsmShell *shell)
564-{
565- if (shell->priv->update_idle_id != 0) {
566- g_source_remove (shell->priv->update_idle_id);
567- shell->priv->update_idle_id = 0;
568- }
569-
570- g_signal_handlers_disconnect_by_func (shell->priv->inhibitors,
571- G_CALLBACK (queue_end_session_dialog_update),
572- shell);
573-
574- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CANCELED], 0);
575-}
576-
577-static void
578-on_end_session_dialog_confirmed_logout (DBusGProxy *proxy,
579- GsmShell *shell)
580-{
581- if (shell->priv->update_idle_id != 0) {
582- g_source_remove (shell->priv->update_idle_id);
583- shell->priv->update_idle_id = 0;
584- }
585-
586- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_LOGOUT], 0);
587-}
588-
589-static void
590-on_end_session_dialog_confirmed_shutdown (DBusGProxy *proxy,
591- GsmShell *shell)
592-{
593- if (shell->priv->update_idle_id != 0) {
594- g_source_remove (shell->priv->update_idle_id);
595- shell->priv->update_idle_id = 0;
596- }
597-
598- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_SHUTDOWN], 0);
599-}
600-
601-static void
602-on_end_session_dialog_confirmed_reboot (DBusGProxy *proxy,
603- GsmShell *shell)
604-{
605- if (shell->priv->update_idle_id != 0) {
606- g_source_remove (shell->priv->update_idle_id);
607- shell->priv->update_idle_id = 0;
608- }
609-
610- g_signal_emit (G_OBJECT (shell), signals[END_SESSION_DIALOG_CONFIRMED_REBOOT], 0);
611-}
612-
613-static void
614-on_end_session_dialog_proxy_destroyed (DBusGProxy *proxy,
615- GsmShell *shell)
616-{
617- /* FIXME - is this right? */
618- if (shell->priv->end_session_dialog_proxy != NULL) {
619- g_object_unref (shell->priv->proxy);
620- shell->priv->end_session_dialog_proxy = NULL;
621- }
622-}
623-
624-static gboolean
625-on_need_end_session_dialog_update (GsmShell *shell)
626-{
627- /* No longer need an update */
628- if (shell->priv->update_idle_id == 0)
629- return FALSE;
630-
631- shell->priv->update_idle_id = 0;
632-
633- gsm_shell_open_end_session_dialog (shell,
634- shell->priv->end_session_dialog_type,
635- shell->priv->inhibitors);
636- return FALSE;
637-}
638-
639-static void
640-queue_end_session_dialog_update (GsmShell *shell)
641-{
642- if (shell->priv->update_idle_id != 0)
643- return;
644-
645- shell->priv->update_idle_id = g_idle_add ((GSourceFunc) on_need_end_session_dialog_update,
646- shell);
647-}
648-
649-gboolean
650-gsm_shell_open_end_session_dialog (GsmShell *shell,
651- GsmShellEndSessionDialogType type,
652- GsmStore *inhibitors)
653-{
654- DBusGProxyCall *call;
655- GPtrArray *inhibitor_array;
656- GError *error;
657-
658- error = NULL;
659- if (!gsm_shell_ensure_connection (shell, &error)) {
660- g_warning ("Could not connect to the shell: %s",
661- error->message);
662- g_error_free (error);
663- return FALSE;
664- }
665-
666- if (shell->priv->end_session_open_call != NULL) {
667- g_return_val_if_fail (shell->priv->end_session_dialog_type == type,
668- FALSE);
669-
670- return TRUE;
671- }
672-
673- if (shell->priv->end_session_dialog_proxy == NULL) {
674- DBusGProxy *proxy;
675-
676- proxy = dbus_g_proxy_new_for_name (shell->priv->bus_connection,
677- SHELL_NAME,
678- SHELL_END_SESSION_DIALOG_PATH,
679- SHELL_END_SESSION_DIALOG_INTERFACE);
680-
681- g_assert (proxy != NULL);
682-
683- shell->priv->end_session_dialog_proxy = proxy;
684-
685- g_signal_connect (proxy, "destroy",
686- G_CALLBACK (on_end_session_dialog_proxy_destroyed),
687- shell);
688-
689- dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
690- "Closed", G_TYPE_INVALID);
691- dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
692- "Closed",
693- G_CALLBACK (on_end_session_dialog_closed),
694- shell, NULL);
695-
696- dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
697- "Canceled", G_TYPE_INVALID);
698- dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
699- "Canceled",
700- G_CALLBACK (on_end_session_dialog_canceled),
701- shell, NULL);
702- dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
703- "ConfirmedLogout", G_TYPE_INVALID);
704- dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
705- "ConfirmedLogout",
706- G_CALLBACK (on_end_session_dialog_confirmed_logout),
707- shell, NULL);
708- dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
709- "ConfirmedShutdown", G_TYPE_INVALID);
710- dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
711- "ConfirmedShutdown",
712- G_CALLBACK (on_end_session_dialog_confirmed_shutdown),
713- shell, NULL);
714- dbus_g_proxy_add_signal (shell->priv->end_session_dialog_proxy,
715- "ConfirmedReboot", G_TYPE_INVALID);
716- dbus_g_proxy_connect_signal (shell->priv->end_session_dialog_proxy,
717- "ConfirmedReboot",
718- G_CALLBACK (on_end_session_dialog_confirmed_reboot),
719- shell, NULL);
720- }
721-
722- inhibitor_array = get_array_from_store (inhibitors);
723-
724- call = dbus_g_proxy_begin_call_with_timeout (shell->priv->end_session_dialog_proxy,
725- "Open",
726- (DBusGProxyCallNotify)
727- on_open_finished,
728- shell,
729- NULL,
730- INT_MAX,
731- G_TYPE_UINT,
732- (guint) type,
733- G_TYPE_UINT,
734- (guint) 0,
735- G_TYPE_UINT,
736- AUTOMATIC_ACTION_TIMEOUT,
737- GSM_SHELL_DBUS_TYPE_G_OBJECT_PATH_ARRAY,
738- inhibitor_array,
739- G_TYPE_INVALID);
740- g_ptr_array_foreach (inhibitor_array, (GFunc) g_free, NULL);
741- g_ptr_array_free (inhibitor_array, TRUE);
742-
743- if (call == NULL) {
744- g_warning ("Unable to make Open call");
745- return FALSE;
746- }
747-
748- g_object_ref (inhibitors);
749-
750- if (shell->priv->inhibitors != NULL) {
751- g_signal_handlers_disconnect_by_func (shell->priv->inhibitors,
752- G_CALLBACK (queue_end_session_dialog_update),
753- shell);
754- g_object_unref (shell->priv->inhibitors);
755- }
756-
757- shell->priv->inhibitors = inhibitors;
758-
759- g_signal_connect_swapped (inhibitors, "added",
760- G_CALLBACK (queue_end_session_dialog_update),
761- shell);
762-
763- g_signal_connect_swapped (inhibitors, "removed",
764- G_CALLBACK (queue_end_session_dialog_update),
765- shell);
766-
767- shell->priv->end_session_open_call = call;
768- shell->priv->end_session_dialog_type = type;
769-
770- return TRUE;
771-}
772-
773-void
774-gsm_shell_close_end_session_dialog (GsmShell *shell)
775-{
776- if (!shell->priv->end_session_dialog_proxy)
777- return;
778-
779- dbus_g_proxy_call_no_reply (shell->priv->end_session_dialog_proxy, "Close", G_TYPE_INVALID);
780-}
781
782=== modified file 'debian/changelog'
783--- debian/changelog 2013-10-11 15:45:25 +0000
784+++ debian/changelog 2013-12-04 09:35:55 +0000
785@@ -1,3 +1,10 @@
786+gnome-session (3.9.90-0ubuntu4) UNRELEASED; urgency=low
787+
788+ * debian/gnome-session.user-session.upstart: Unset Upstart event
789+ variables to avoid stop(8) from stopping the users session (LP: #1256262).
790+
791+ -- James Hunt <james.hunt@ubuntu.com> Wed, 04 Dec 2013 09:31:07 +0000
792+
793 gnome-session (3.9.90-0ubuntu3) saucy; urgency=low
794
795 * debian/patches/git_fix_wrong_unref_call.patch:
796
797=== modified file 'debian/gnome-session.user-session.upstart'
798--- debian/gnome-session.user-session.upstart 2013-05-22 12:55:52 +0000
799+++ debian/gnome-session.user-session.upstart 2013-12-04 09:35:55 +0000
800@@ -9,7 +9,10 @@
801 emits desktop-start
802 emits desktop-end
803
804+script
805+unset UPSTART_EVENTS UPSTART_INSTANCE UPSTART_JOB
806 exec gnome-session --session=$DESKTOP_SESSION
807+end script
808
809 post-start exec initctl emit desktop-start DESKTOP_SESSION=$DESKTOP_SESSION
810

Subscribers

People subscribed via source and target branches

to all changes: