summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-10-15 04:14:58 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-10-15 04:14:58 +0000
commit1c1f4d7c938b9226310f405db4b589f56ce171c2 (patch)
tree207505bfd42cfed987979a23bb2957be841989c1 /src/tools
parenta29c93a95a94a3da8f03d727e5b77848ae673292 (diff)
downloadmetacity-1c1f4d7c938b9226310f405db4b589f56ce171c2.tar.gz
metacity-1c1f4d7c938b9226310f405db4b589f56ce171c2.tar.bz2
add a restart feature, for debugging
2001-10-15 Havoc Pennington <hp@pobox.com> * src/main.c (meta_restart): add a restart feature, for debugging * src/tools/metacity-restart.c: little utility program to trigger the restart
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/Makefile.am9
-rw-r--r--src/tools/metacity-restart.c56
2 files changed, 65 insertions, 0 deletions
diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am
new file mode 100644
index 0000000..0db4a69
--- /dev/null
+++ b/src/tools/Makefile.am
@@ -0,0 +1,9 @@
+
+INCLUDES=@METACITY_RESTART_CFLAGS@
+
+metacity_restart_SOURCES= \
+ metacity-restart.c
+
+bin_PROGRAMS=metacity-restart
+
+metacity_restart_LDADD= @METACITY_RESTART_LIBS@
diff --git a/src/tools/metacity-restart.c b/src/tools/metacity-restart.c
new file mode 100644
index 0000000..c1eacba
--- /dev/null
+++ b/src/tools/metacity-restart.c
@@ -0,0 +1,56 @@
+/* Metacity restart app */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
+int
+main (int argc, char **argv)
+{
+ XEvent xev;
+
+ gtk_init (&argc, &argv);
+
+ xev.xclient.type = ClientMessage;
+ xev.xclient.serial = 0;
+ xev.xclient.send_event = True;
+ xev.xclient.display = gdk_display;
+ xev.xclient.window = gdk_x11_get_default_root_xwindow ();
+ xev.xclient.message_type = XInternAtom (gdk_display,
+ "_METACITY_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 (gdk_display,
+ gdk_x11_get_default_root_xwindow (),
+ False,
+ SubstructureRedirectMask | SubstructureNotifyMask,
+ &xev);
+
+ XFlush (gdk_display);
+ XSync (gdk_display, False);
+
+ return 0;
+}
+