~xubuntu-dev/ubiquity/lp1437180_feh

« back to all changes in this revision

Viewing changes to bin/ubiquity-dm

  • Committer: Colin Watson
  • Date: 2007-09-06 12:46:23 UTC
  • Revision ID: cjwatson@canonical.com-20070906124623-dilzipnw7bxpmt8n
run gnome-settings-daemon so that we use the normal theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
                root.clear()
81
81
                gtk.gdk.flush()
82
82
 
 
83
        extras = []
83
84
        if self.frontend == 'gtk_ui':
84
85
            wm = subprocess.Popen(['/usr/bin/metacity', '--sm-disable'], stdin=null, stdout=logfile, stderr=logfile)
 
86
            extras.append(subprocess.Popen(['/usr/lib/gnome-control-center/gnome-settings-daemon'], stdin=null, stdout=logfile, stderr=logfile))
85
87
        elif self.frontend == 'kde_ui':
86
88
            wm = subprocess.Popen('/usr/bin/kwin', stdin=null, stdout=logfile, stderr=logfile)
87
89
 
90
92
 
91
93
        def sigalrm_handler(signum, frame):
92
94
            os.kill(wm.pid, signal.SIGKILL)
 
95
            for extra in extras:
 
96
                os.kill(extra.pid, signal.SIGKILL)
93
97
 
94
98
        os.kill(wm.pid, signal.SIGTERM)
 
99
        for extra in extras:
 
100
            os.kill(extra.pid, signal.SIGTERM)
95
101
        signal.signal(signal.SIGALRM, sigalrm_handler)
96
102
        signal.alarm(1) # low patience with WMs failing to exit on demand
97
 
        while True:
98
 
            try:
99
 
                wm.wait()
100
 
            except OSError, e:
101
 
                if e.errno == errno.EINTR:
102
 
                    continue
103
 
                raise
104
 
            break
 
103
        processes = set(extras)
 
104
        processes.add(wm)
 
105
        while processes:
 
106
            done = set()
 
107
            for process in processes:
 
108
                try:
 
109
                    process.wait()
 
110
                    done.add(process)
 
111
                except OSError, e:
 
112
                    if e.errno == errno.EINTR:
 
113
                        continue
 
114
                    raise
 
115
            processes -= done
105
116
        signal.alarm(0)
106
117
        os.kill(server.pid, signal.SIGTERM)
107
118
        server.wait()