mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
Remove meta_restart() / "mutter-message restart"
meta_restart() was broken, in that it restarted mutter with what was left of argv after GOption and Clutter had possibly modified it. Rather than try to fix this, just remove it. https://bugzilla.gnome.org/show_bug.cgi?id=643959
This commit is contained in:
parent
4c76791d4c
commit
28752718c5
@ -2524,12 +2524,6 @@ event_callback (XEvent *event,
|
||||
meta_workspace_focus_default_window (screen->active_workspace, NULL, timestamp);
|
||||
}
|
||||
}
|
||||
else if (event->xclient.message_type ==
|
||||
display->atom__MUTTER_RESTART_MESSAGE)
|
||||
{
|
||||
meta_verbose ("Received restart request\n");
|
||||
meta_restart ();
|
||||
}
|
||||
else if (event->xclient.message_type ==
|
||||
display->atom__MUTTER_RELOAD_THEME_MESSAGE)
|
||||
{
|
||||
|
@ -89,12 +89,6 @@ static MetaExitCode meta_exit_code = META_EXIT_SUCCESS;
|
||||
*/
|
||||
static GMainLoop *meta_main_loop = NULL;
|
||||
|
||||
/**
|
||||
* If set, Mutter will spawn an identical copy of itself immediately
|
||||
* before quitting.
|
||||
*/
|
||||
static gboolean meta_restart_after_quit = FALSE;
|
||||
|
||||
static void prefs_changed_callback (MetaPreference pref,
|
||||
gpointer data);
|
||||
|
||||
@ -697,36 +691,15 @@ main (int argc, char **argv)
|
||||
|
||||
meta_finalize ();
|
||||
|
||||
if (meta_restart_after_quit)
|
||||
{
|
||||
GError *err;
|
||||
|
||||
err = NULL;
|
||||
if (!g_spawn_async (NULL,
|
||||
argv,
|
||||
NULL,
|
||||
G_SPAWN_SEARCH_PATH,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&err))
|
||||
{
|
||||
meta_fatal (_("Failed to restart: %s\n"),
|
||||
err->message);
|
||||
g_error_free (err); /* not reached anyhow */
|
||||
meta_exit_code = META_EXIT_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return meta_exit_code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops Mutter. This tells the event loop to stop processing; it is rather
|
||||
* dangerous to use this rather than meta_restart() because this will leave
|
||||
* the user with no window manager. We generally do this only if, for example,
|
||||
* the session manager asks us to; we assume the session manager knows what
|
||||
* it's talking about.
|
||||
* Stops Mutter. This tells the event loop to stop processing; it is
|
||||
* rather dangerous to use this because this will leave the user with
|
||||
* no window manager. We generally do this only if, for example, the
|
||||
* session manager asks us to; we assume the session manager knows
|
||||
* what it's talking about.
|
||||
*
|
||||
* \param code The success or failure code to return to the calling process.
|
||||
*/
|
||||
@ -739,19 +712,6 @@ meta_quit (MetaExitCode code)
|
||||
g_main_loop_quit (meta_main_loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restarts Mutter. In practice, this tells the event loop to stop
|
||||
* processing, having first set the meta_restart_after_quit flag which
|
||||
* tells Mutter to spawn an identical copy of itself before quitting.
|
||||
* This happens on receipt of a _MUTTER_RESTART_MESSAGE client event.
|
||||
*/
|
||||
void
|
||||
meta_restart (void)
|
||||
{
|
||||
meta_restart_after_quit = TRUE;
|
||||
meta_quit (META_EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on pref changes. (One of several functions of its kind and purpose.)
|
||||
*
|
||||
|
@ -54,7 +54,6 @@ item(WM_WINDOW_ROLE)
|
||||
item(UTF8_STRING)
|
||||
item(WM_ICON_SIZE)
|
||||
item(_KWM_WIN_ICON)
|
||||
item(_MUTTER_RESTART_MESSAGE)
|
||||
item(_MUTTER_RELOAD_THEME_MESSAGE)
|
||||
item(_MUTTER_SET_KEYBINDINGS_MESSAGE)
|
||||
item(_MUTTER_TOGGLE_VERBOSE)
|
||||
|
@ -38,6 +38,4 @@ void meta_exit (MetaExitCode code);
|
||||
/* g_main_loop_quit() then fall out of main() */
|
||||
void meta_quit (MetaExitCode code);
|
||||
|
||||
void meta_restart (void);
|
||||
|
||||
#endif
|
||||
|
@ -31,34 +31,6 @@
|
||||
|
||||
static Display *display;
|
||||
|
||||
static void
|
||||
send_restart (void)
|
||||
{
|
||||
XEvent xev;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.serial = 0;
|
||||
xev.xclient.send_event = True;
|
||||
xev.xclient.display = display;
|
||||
xev.xclient.window = gdk_x11_get_default_root_xwindow ();
|
||||
xev.xclient.message_type = XInternAtom (display,
|
||||
"_MUTTER_RESTART_MESSAGE",
|
||||
False);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.data.l[0] = 0;
|
||||
xev.xclient.data.l[1] = 0;
|
||||
xev.xclient.data.l[2] = 0;
|
||||
|
||||
XSendEvent (display,
|
||||
gdk_x11_get_default_root_xwindow (),
|
||||
False,
|
||||
SubstructureRedirectMask | SubstructureNotifyMask,
|
||||
&xev);
|
||||
|
||||
XFlush (display);
|
||||
XSync (display, False);
|
||||
}
|
||||
|
||||
static void
|
||||
send_reload_theme (void)
|
||||
{
|
||||
@ -149,7 +121,7 @@ static void
|
||||
usage (void)
|
||||
{
|
||||
g_printerr (_("Usage: %s\n"),
|
||||
"mutter-message (restart|reload-theme|enable-keybindings|disable-keybindings|toggle-verbose)");
|
||||
"mutter-message (reload-theme|enable-keybindings|disable-keybindings|toggle-verbose)");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
@ -165,9 +137,7 @@ main (int argc, char **argv)
|
||||
|
||||
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
||||
|
||||
if (strcmp (argv[1], "restart") == 0)
|
||||
send_restart ();
|
||||
else if (strcmp (argv[1], "reload-theme") == 0)
|
||||
if (strcmp (argv[1], "reload-theme") == 0)
|
||||
send_reload_theme ();
|
||||
else if (strcmp (argv[1], "enable-keybindings") == 0)
|
||||
send_set_keybindings (TRUE);
|
||||
|
Loading…
Reference in New Issue
Block a user