Add support for meta_restart() and MetaDisplay::restart

Support was added to Mutter to allow it to trigger a restart
to allow for restarts when switching in or out of stereo mode.

Hook up to the new signals on MetaDisplay to show the restart
message and reexec. Meta.is_restart() is used to suppress
the startup animation.

This also allows us to do 'Alt-F2 r' restarts more cleanly
without a visual flash and animation.

https://bugzilla.gnome.org/show_bug.cgi?id=733026
This commit is contained in:
Owen W. Taylor
2014-05-08 18:56:23 -04:00
parent 46c86e093c
commit b6f3e15037
5 changed files with 76 additions and 22 deletions

View File

@ -50,14 +50,10 @@ const RunDialog = new Lang.Class({
Main.createLookingGlass().open();
}),
'r': Lang.bind(this, function() {
global.reexec_self();
}),
'r': Lang.bind(this, this._restart),
// Developer brain backwards compatibility
'restart': Lang.bind(this, function() {
global.reexec_self();
}),
'restart': Lang.bind(this, this._restart),
'debugexit': Lang.bind(this, function() {
Meta.quit(Meta.ExitCode.ERROR);
@ -271,6 +267,12 @@ const RunDialog = new Lang.Class({
}
},
_restart: function() {
this._shouldFadeOut = false;
this.close();
Meta.restart('Restarting...');
},
open: function() {
this._history.lastItem();
this._errorBox.hide();