From 0ae87270ad00688905332e287f4ad493c1cbe02b Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 12 Apr 2012 19:51:40 +0200 Subject: [PATCH] jhbuild wrapper: don't try to "restore GNOME" If run under jhbuild, gnome-shell is in PATH, so trying to restore is just running it again, likely failing in the same way (with the additional problem of detaching the shell from the terminal). Also, this is using deprecated GConf keys, and deprecated pygobject bindings. --- src/gnome-shell-jhbuild.in | 54 +------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/src/gnome-shell-jhbuild.in b/src/gnome-shell-jhbuild.in index 6d1a7a7a6..d2f2e545c 100755 --- a/src/gnome-shell-jhbuild.in +++ b/src/gnome-shell-jhbuild.in @@ -163,48 +163,6 @@ def run_shell(): return normal_exit - -def restore_gnome(): - # Do imports lazily to save time and memory - import gio - import gconf - - # We don't want to start the new gnome-panel in the current - # directory; $HOME is better for stuff launched from it - os.chdir(os.path.expanduser("~")) - - def launch_component(gconf_path): - client = gconf.client_get_default() - component = client.get_string(gconf_path) - - if component == None or component == "": - return False - - # See gnome-session/gsm-util.c:gsm_util_find_desktop_file_for_app_name() - # The one difference is that we don't search the autostart directories, - # and just search normal application search path. (Gio doesnt' know - # how to search the autostart dirs, so we'd have to do that ourselves.) - appinfo = None - try: - appinfo = gio.unix.DesktopAppInfo(component + ".desktop") - except: - try: - appinfo = gio.unix.DesktopAppInfo("gnome-" + component + ".desktop") - except: - pass - - if appinfo: - appinfo.launch() - return True - return False - - # GNOME2 fallback - wm = launch_component("/desktop/gnome/session/required_components/windowmanager") - panel = launch_component("/desktop/gnome/session/required_components/panel") - - if not wm and not panel: # Probably GNOME3 - subprocess.Popen(['gnome-shell']) - # Main program parser = optparse.OptionParser() @@ -235,17 +193,7 @@ if options.debug_command: elif options.debug: options.debug_command = "gdb --args" -# We only respawn the previous environment on abnormal exit; -# for a clean exit, we assume that gnome-shell was replaced with -# something else. -normal_exit = False - -try: - normal_exit = run_shell() -finally: - if options.replace and not normal_exit: - restore_gnome() - +normal_exit = run_shell() if normal_exit: sys.exit(0) else: