~ubuntu-branches/ubuntu/maverick/gdm/maverick

« back to all changes in this revision

Viewing changes to .pc/15_default_session.patch/daemon/gdm-session-direct.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Sebastien Bacher, Kees Cook, Robert Ancell, Martin Pitt
  • Date: 2010-08-06 13:02:51 UTC
  • mfrom: (1.4.45 upstream)
  • Revision ID: james.westby@ubuntu.com-20100806130251-dqy5pufiii6fb20m
Tags: 2.30.4-0ubuntu1
[ Sebastien Bacher ]
* New upstream versions:
  - Translation fixes
  - Many performance improvements for the greeter
  - Various robustness fixes
  - Fix XDMCP
  - Fix switch user menu item detection
  - Remove obsolete restart and stop scripts
  - Fixed #618834, GdmProductSlave does not handle OpenSession 
  - Fixed #342397, gdm doesn't respond to XDMCP querys if local X server fails
    to start 
  - Fixed #544730, XDMCP broadcast discovery not working on BSD w/ ipv6 
    enabled (lp: #393835)
  - Fixed #589536, gdm-simple-slave crashed with signal 5 in 
    g_return_if_fail_warning (lp: #403441)
  - Fixed #592183, GDM entry field loses focus after dialogs are presented 
  - Fixed #594857, Warning when type 'gdm --version' in terminal in new GDM 
  - Fixed #599683, xdmcp Queries from Older software 
  - Fixed #610179, GDM patch for accounts dialogue 
  - Fixed #616722, Xdmcp linking problem 
  - Fixed #616730, user-switch-applet build failure: missing -I for dbus-glib 
  - Fixed #617665, Panel doesn't shrink after disabling "high contrast" 
  - Fixed #619588, User's Real names should be escaped against XML markup 
    (lp: #499690, #585128)
  - Fixed #620430, memory leaks in gdm 
  - Fixed #620893, bottom panel is overlapping at smaller sizes 
  - Fixed #620908, gdm user switch applet goes nuts while 
    changing password file 
  - Fixed #621045, Improve startup performance of the greeter 
  - Fixed #621131, User switch applet performance issues 
  - Fixed #621661, Make slaves more robust against crashes 
  - Fixed #622069, greeter doesn't work when there's no local user 
  - Fixed #622337, shows shutdown buttons when connecting over xdmcp 
  - Fixed #622430, keyboard layout handling wonky 
  - Fixed #622431, cancel button not shown during timed login 
  - Fixed #601458, Add presence items to status menu and port to JS 
* Refresh distribution changes
* debian/patches/07_correct_distribution_version.patch:
  - use upstream version
* debian/patches/13_cache_ck_history.patch:
  - dropped since the new upstream version solves this issue differently
* debian/patches/23_login_window_hint.patch:
  - dropped, the change is in the new version

[ Kees Cook ]
* debian/patches/24_system_uid.patch: - updated for upstream code changes

[ Robert Ancell ]
* debian/xsession.desktop:
* debian/xterm.desktop:
  - Use clearer session names (LP: #599336)
* debian/patches/09_gdmsetup.patch:
  - Remove session comment from combo box to make it fit better

[ Martin Pitt ]
* 09_gdmsetup.patch: Only show "Play Login Sound" checkbox if we have
  /usr/share/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop.
* Add 01_upower.patch: Port to UPower.
* debian/control: libdevkit-power-gobject-dev → libupower-glib-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        char                *display_x11_authority_file;
95
95
        gboolean             display_is_local;
96
96
 
 
97
        char                *fallback_session_name;
 
98
 
97
99
        DBusServer          *server;
98
100
        char                *server_address;
99
101
        GHashTable          *environment;
493
495
{
494
496
        GKeyFile   *key_file;
495
497
        GError     *error;
496
 
        char       *full_path;
497
498
        char       *exec;
498
499
        gboolean    ret;
499
500
        gboolean    res;
509
510
        g_debug ("GdmSessionDirect: looking for session file '%s'", file);
510
511
 
511
512
        error = NULL;
512
 
        full_path = NULL;
513
513
        res = g_key_file_load_from_dirs (key_file,
514
514
                                         file,
515
515
                                         get_system_session_dirs (),
516
 
                                         &full_path,
 
516
                                         NULL,
517
517
                                         G_KEY_FILE_NONE,
518
518
                                         &error);
519
519
        if (! res) {
644
644
    return session->priv->saved_layout;
645
645
}
646
646
 
647
 
static char *
648
 
get_fallback_session_name (void)
 
647
static const char *
 
648
get_fallback_session_name (GdmSessionDirect *session_direct)
649
649
{
650
650
        const char  **search_dirs;
651
651
        int           i;
652
652
        char         *name;
 
653
        GSequence    *sessions;
 
654
        GSequenceIter *session;
 
655
 
 
656
        if (session_direct->priv->fallback_session_name != NULL) {
 
657
                /* verify that the cached version still exists */
 
658
                if (get_session_command_for_name (session_direct->priv->fallback_session_name, NULL)) {
 
659
                        goto out;
 
660
                }
 
661
        }
653
662
 
654
663
        name = g_strdup ("gnome");
655
664
        if (get_session_command_for_name (name, NULL)) {
656
 
                return name;
 
665
                g_free (session_direct->priv->fallback_session_name);
 
666
                session_direct->priv->fallback_session_name = name;
 
667
                goto out;
657
668
        }
 
669
        g_free (name);
 
670
 
 
671
        sessions = g_sequence_new (g_free);
658
672
 
659
673
        search_dirs = get_system_session_dirs ();
660
674
        for (i = 0; search_dirs[i] != NULL; i++) {
661
 
                GDir *dir;
 
675
                GDir       *dir;
662
676
                const char *base_name;
663
677
 
664
678
                dir = g_dir_open (search_dirs[i], 0, NULL);
679
693
                        }
680
694
 
681
695
                        if (get_session_command_for_file (base_name, NULL)) {
682
 
                                g_free (name);
683
696
 
684
 
                                name = g_strndup (base_name,
685
 
                                                  strlen (base_name) -
686
 
                                                  strlen (".desktop"));
687
 
                                break;
 
697
                                g_sequence_insert_sorted (sessions, g_strdup (base_name), (GCompareDataFunc) g_strcmp0, NULL);
688
698
                        }
689
699
                } while (base_name != NULL);
690
700
 
691
701
                g_dir_close (dir);
692
702
        }
693
703
 
694
 
        return name;
 
704
        name = NULL;
 
705
        session = g_sequence_get_begin_iter (sessions);
 
706
        do {
 
707
               if (g_sequence_get (session)) {
 
708
                       char *base_name;
 
709
 
 
710
                       g_free (name);
 
711
                       base_name = g_sequence_get (session);
 
712
                       name = g_strndup (base_name,
 
713
                                         strlen (base_name) -
 
714
                                         strlen (".desktop"));
 
715
 
 
716
                       break;
 
717
               }
 
718
               session = g_sequence_iter_next (session);
 
719
        } while (!g_sequence_iter_is_end (session));
 
720
 
 
721
        g_free (session_direct->priv->fallback_session_name);
 
722
        session_direct->priv->fallback_session_name = name;
 
723
 
 
724
        g_sequence_free (sessions);
 
725
 
 
726
 out:
 
727
        return session_direct->priv->fallback_session_name;
695
728
}
696
729
 
697
730
static const char *
701
734
                return session->priv->saved_session;
702
735
        }
703
736
 
704
 
        return get_fallback_session_name ();
 
737
        return get_fallback_session_name (session);
705
738
}
706
739
 
707
740
static void
2186
2219
        gboolean    res;
2187
2220
        gboolean    bypasses_xsession = FALSE;
2188
2221
        char       *filename;
2189
 
        char       *full_path;
2190
2222
 
2191
2223
        g_return_val_if_fail (session_direct != NULL, FALSE);
2192
2224
        g_return_val_if_fail (GDM_IS_SESSION_DIRECT (session_direct), FALSE);
2198
2230
        res = g_key_file_load_from_dirs (key_file,
2199
2231
                                         filename,
2200
2232
                                         get_system_session_dirs (),
2201
 
                                         &full_path,
 
2233
                                         NULL,
2202
2234
                                         G_KEY_FILE_NONE,
2203
2235
                                         &error);
2204
2236
        if (! res) {
2476
2508
        g_free (session->priv->selected_layout);
2477
2509
        g_free (session->priv->saved_layout);
2478
2510
 
 
2511
        g_free (session->priv->fallback_session_name);
 
2512
 
2479
2513
        parent_class = G_OBJECT_CLASS (gdm_session_direct_parent_class);
2480
2514
 
2481
2515
        if (parent_class->finalize != NULL)