Instead of starting Xephyr automatically, require --xephyr to be
passed explicitly.
This makes the operation easier to understand and has the benefit
of allowing running in Xephyr mode when some other window manager
(like gnome-shell!) is running. We also want to emphasize that
Xephyr is a development tool, and not a good preview of the
user-interface.
http://bugzilla.gnome.org/show_bug.cgi?id=592881
If Mutter exits with an exit status of 0, then that most likely
means that it was replaced by another window manager and we shoudln't
try to start the previous window manager and the panel.
(We don't actually know about the panel, but assume that if someone
is replacing us they know what they are doing.)
When Mutter exits with a signal, we know we want to restart.
When Mutter exits with a non-signal non-zero exit status, it's
ambiguous - we could be exiting because we lost the connection to
the X server, or because of a assertion failure in gnome-shell.
We assume the latter; if the X server is gone, all that will happen
is a bit of noise.
To know why Mutter exited accurately, we always wait() and
kill() the Mutter process, and then, if running in Xephyr, clean up
Xephyr afterwards. This has the nice side effect of exiting when
gnome-shell does and not forcing the user to close Xephyr manually.
http://bugzilla.gnome.org/show_bug.cgi?id=591171
When exiting from --replace mode, we want to start the new
gnome-panel with a reasonable working directory so that if, you say,
open a terminal from it it doesn't start off in the gnome-shell
directory.
(gnome-shell itself is running in $HOME because mutter changes
directory itself at startup.)
Reported by Mathieu Bridon
http://bugzilla.gnome.org/show_bug.cgi?id=591145
Avoid depending on gdb for replacing an existing panel, since it
requires debuginfo and gdb installed.
Instead we grab the org.gnome.Panel DBus name, using DBus name
replacement semantics.
Recent gjs changes have made it log most types of messages (including
log() calls) only to a configured log file and not to stderr. So,
set GJS_DEBUG_OUTPUT=stderr to make *stderr* the log file and get
our log() calls back.
Unless we're running gnome-shell from the source directory, we shouldn't
use the .la file as the mutter plugin. Instead, we use the dynamic
library.
Closes: bgo#581327
If Xephyr isn't installed currently src/gnome-shell raises
an exception which isn't at all obvious without looking at
the source. This commit catches the exception and replaces
it with a more informative error message.