~ubuntu-branches/ubuntu/natty/gnome-session/natty

« back to all changes in this revision

Viewing changes to .pc/22_support_autostart_delay.patch/gnome-session/gsm-autostart-app.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-01-11 21:59:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110111215906-fflqnz5lquqiv8ad
Tags: 2.32.1-0ubuntu10
* debian/patches/06_launch_session_requirement_before_saved_session.patch,
  debian/patches/03_no_required_component_saved_in_main_session.patch:
  - revert to older session management and workaround to avoid loading a panel
    or a windowmanager other than compiz + unity from a saved component
* debian/patches/03_no_required_component_saved_in_main_session.patch:
  don't start gnome-panel, metacity/mutter from saved session in the
  ubuntu session.
* debian/patches/11_add_failsafe_option.patch:
  - create a 2d-gnome session type instead of failsafe and point the failsafe
    session to it
* debian/patches/12_add_gnome-2d_session.patch:
  - create a metacity + gnome-panel session without any graphical effect

Show diffs side-by-side

added added

removed removed

Lines of Context:
779
779
        gboolean         success;
780
780
        GError          *local_error;
781
781
        const char      *startup_id;
 
782
        gboolean         start_app = TRUE;
782
783
        char            *command;
783
784
 
784
785
        startup_id = gsm_app_peek_startup_id (GSM_APP (app));
798
799
        }
799
800
 
800
801
        g_debug ("GsmAutostartApp: starting %s: command=%s startup-id=%s", app->priv->desktop_id, command, startup_id);
 
802
 
 
803
        // don't start gnome-panel, metacity/compiz/mutter from saved session in
 
804
        // default ubuntu session
 
805
        // This is a current workaround to bug #578585. A correct fix
 
806
        // will be to integrate a migration path, excluding all
 
807
        // required_components from the saved list before starting them.
 
808
        if (g_strcmp0 (g_getenv ("GDMSESSION"), "gnome\0") == 0) {
 
809
                if (g_strrstr (command, "gnome-panel --sm-client-id\0")
 
810
                 || g_strrstr (command, "metacity\0")
 
811
                 || g_strrstr (command, "mutter\0")
 
812
                 || g_strrstr (command, "compiz --sm-client-id\0")) {
 
813
                   g_debug ("GsmAutostartApp: %s BLACKLISTED in ubuntu session", command);
 
814
                   success = FALSE;
 
815
                   start_app = FALSE;
 
816
                }
 
817
        }
 
818
 
801
819
        g_free (command);
802
820
 
803
821
        g_free (app->priv->startup_id);
804
822
        local_error = NULL;
805
 
        success = egg_desktop_file_launch (app->priv->desktop_file,
806
 
                                           NULL,
807
 
                                           &local_error,
808
 
                                           EGG_DESKTOP_FILE_LAUNCH_PUTENV, env,
809
 
                                           EGG_DESKTOP_FILE_LAUNCH_FLAGS, G_SPAWN_DO_NOT_REAP_CHILD,
810
 
                                           EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, &app->priv->pid,
811
 
                                           EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID, &app->priv->startup_id,
812
 
                                           NULL);
 
823
        if (start_app)
 
824
                success = egg_desktop_file_launch (app->priv->desktop_file,
 
825
                                                   NULL,
 
826
                                                  &local_error,
 
827
                                                   EGG_DESKTOP_FILE_LAUNCH_PUTENV, env,
 
828
                                                   EGG_DESKTOP_FILE_LAUNCH_FLAGS, G_SPAWN_DO_NOT_REAP_CHILD,
 
829
                                                   EGG_DESKTOP_FILE_LAUNCH_RETURN_PID, &app->priv->pid,
 
830
                                                   EGG_DESKTOP_FILE_LAUNCH_RETURN_STARTUP_ID, &app->priv->startup_id,
 
831
                                                   NULL);
813
832
        g_free (env[0]);
814
833
 
815
834
        if (success) {
818
837
                                                               (GChildWatchFunc)app_exited,
819
838
                                                               app);
820
839
        } else {
821
 
                g_set_error (error,
822
 
                             GSM_APP_ERROR,
823
 
                             GSM_APP_ERROR_START,
824
 
                             "Unable to start application: %s", local_error->message);
825
 
                g_error_free (local_error);
 
840
                if (start_app) {
 
841
                        g_set_error (error,
 
842
                                     GSM_APP_ERROR,
 
843
                                     GSM_APP_ERROR_START,
 
844
                                     "Unable to start application: %s", local_error->message);
 
845
                        g_error_free (local_error);
 
846
                }
826
847
        }
827
848
 
828
849
        return success;