~ubuntu-branches/ubuntu/lucid/gnome-shell/lucid-updates

« back to all changes in this revision

Viewing changes to src/gnome-shell.in

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-08-11 19:36:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090811193626-05vzd2jssuwow57x
Tags: 2.27.0-0ubuntu1
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
import termios
14
14
import time
15
15
import errno
 
16
import dbus
16
17
 
17
18
def find_cmd (cmd_list):
18
19
    """
122
123
        top_dir = os.path.dirname(bin_dir)
123
124
        plugin = os.path.join(top_dir, 'src', 'libgnome-shell.la')
124
125
        typelib_dir = os.path.join(top_dir, "src")
125
 
        taskpanel_dir = os.path.join(top_dir, "src")
126
126
        js_dir = os.path.join(top_dir, "js")
127
127
        data_dir = os.path.join(top_dir, "data")
128
128
    else:
129
129
        running_from_source_tree = False
130
130
        plugin = 'libgnome-shell'
131
131
        js_dir = os.path.join('@pkgdatadir@', 'js')
132
 
        taskpanel_dir = '@libexecdir@'
133
132
 
134
133
    # Set up environment
135
134
    env = dict(os.environ)
136
135
    env.update({'GNOME_SHELL_JS'      : '@GJS_JS_DIR@:@GJS_JS_NATIVE_DIR@:' + js_dir,
137
 
                'PATH'                : '@MUTTER_BIN_DIR@:' + os.environ.get('PATH', '') + ':' + taskpanel_dir,
 
136
                'PATH'                : '@MUTTER_BIN_DIR@:' + os.environ.get('PATH', ''),
138
137
                'GNOME_DISABLE_CRASH_DIALOG' : '1'})
139
138
 
140
139
    if running_from_source_tree:
230
229
 
231
230
metacity_pid = pidof("metacity")
232
231
compiz_pid = pidof("compiz.real") or pidof("compiz")
233
 
gnome_panel_pid = pidof("gnome-panel")
 
232
 
 
233
# In Gnome 2.26 the panel grabs a dbus name and allows replacement; use that.
 
234
bus = dbus.Interface(dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'),
 
235
                     'org.freedesktop.DBus')
 
236
names = bus.ListNames()
 
237
gnome_panel_dbus = 'org.gnome.Panel' in names
 
238
if gnome_panel_dbus:
 
239
    gnome_panel_pid = None
 
240
else:
 
241
    gnome_panel_pid = pidof("gnome-panel")
234
242
 
235
243
# Run in Xephyr if gnome-panel is already running and the user didn't
236
244
# specify --replace. Otherwise, run fullscreen
263
271
try:
264
272
    if run_in_xephyr:
265
273
        shell = start_xephyr()
 
274
        # This makes us not grab the org.gnome.Panel name
 
275
        os.environ['GNOME_SHELL_NO_REPLACE_PANEL'] = '1'
266
276
        start_shell()
267
277
    else:
268
278
        if gnome_panel_pid is not None:
291
301
 
292
302
    if not run_in_xephyr:
293
303
        # Restart gnome-panel and window manager
 
304
 
 
305
        # We don't want to start the new gnome-panel in the current
 
306
        # directory; $HOME is better for stuff launched from it
 
307
        os.chdir(os.path.expanduser("~"))
 
308
 
294
309
        if metacity_pid:
295
310
            if options.verbose:
296
311
                print "Restarting Metacity"
299
314
            if options.verbose:
300
315
                print "Restarting Compiz"
301
316
            subprocess.Popen(["/usr/bin/compiz"])
302
 
        if gnome_panel_pid:
 
317
        if gnome_panel_dbus or gnome_panel_pid:
303
318
            if options.verbose:
304
319
                print "Restarting gnome-panel"
305
320
            subprocess.Popen(["/usr/bin/gnome-panel"])