[RFC/WIP] call awesome_restart_delayed via main loop

Fixes `echo 'awesome.restart()' | awesome-client` to not display an
error about failed dbus-send, caused by awesome restarting before
replying through DBus.
This commit is contained in:
Daniel Hahler 2019-02-24 16:17:40 +01:00
parent 36d7535cd5
commit 6f7e8e668e
1 changed files with 9 additions and 2 deletions

View File

@ -524,12 +524,19 @@ exit_on_signal(gpointer data)
return TRUE; return TRUE;
} }
void static gboolean
awesome_restart(void) awesome_restart_delayed(gpointer unused)
{ {
awesome_atexit(true); awesome_atexit(true);
execvp(awesome_argv[0], awesome_argv); execvp(awesome_argv[0], awesome_argv);
fatal("execv() failed: %s", strerror(errno)); fatal("execv() failed: %s", strerror(errno));
return true;
}
void
awesome_restart(void)
{
g_idle_add_full(G_PRIORITY_DEFAULT, awesome_restart_delayed, NULL, NULL);
} }
/** Function to restart awesome on some signals. /** Function to restart awesome on some signals.