mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
make this always return FALSE for now, to avoid bug reports.
2002-12-08 Havoc Pennington <hp@pobox.com> * src/prefs.c (meta_prefs_get_application_based): make this always return FALSE for now, to avoid bug reports. * src/util.c (ensure_logfile): put "opened log file" message on stderr so it will normally land in ~/.xsession-errors * configure.in: remove extra AC_ARG_PROGRAM * src/display.c (event_callback): handle the toggle-verbose message * src/tools/metacity-message.c: add a toggle-verbose message, been meaning to do this for a while. * src/util.c (meta_set_verbose): if verbose mode is enabled and we don't support it, then exit. * src/prefs.c: allow building without gconf (currently means some prefs are no-ops) * src/util.c, src/util.h: support defining macros to kill all verbose output entirely. (Removes the code and strings associated with it) * configure.in: don't get METACITY_PROPS_LIBS if not building the config dialog. (HAVE_GCONF): allow building sans gconf, if you are size-sensitive and not using gnome. (WITH_VERBOSE_MODE): add ability to disable all the verbose debug spew strings, to shrink the binary. (--disable-sm): allow SM support to be forced on or off (--disable-startup-notification): allow forcing this on or off
This commit is contained in:

committed by
Havoc Pennington

parent
15d28dfd97
commit
8d314aead8
@ -19,11 +19,17 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libintl.h>
|
||||
#define _(x) dgettext (GETTEXT_PACKAGE, x)
|
||||
#define N_(x) x
|
||||
|
||||
|
||||
static void
|
||||
send_restart (void)
|
||||
{
|
||||
@ -108,10 +114,41 @@ send_set_keybindings (gboolean enabled)
|
||||
XSync (gdk_display, False);
|
||||
}
|
||||
|
||||
#ifdef WITH_VERBOSE_MODE
|
||||
static void
|
||||
send_toggle_verbose (void)
|
||||
{
|
||||
XEvent xev;
|
||||
|
||||
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_TOGGLE_VERBOSE",
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
usage (void)
|
||||
{
|
||||
g_printerr ("Usage: metacity-message (restart|reload-theme|enable-keybindings|disable-keybindings)\n");
|
||||
g_printerr (_("Usage: %s\n"),
|
||||
"metacity-message (restart|reload-theme|enable-keybindings|disable-keybindings|toggle-verbose)");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
@ -131,6 +168,15 @@ main (int argc, char **argv)
|
||||
send_set_keybindings (TRUE);
|
||||
else if (strcmp (argv[1], "disable-keybindings") == 0)
|
||||
send_set_keybindings (FALSE);
|
||||
else if (strcmp (argv[1], "toggle-verbose") == 0)
|
||||
{
|
||||
#ifndef WITH_VERBOSE_MODE
|
||||
g_printerr (_("Metacity was compiled without support for verbose mode\n"));
|
||||
return 1;
|
||||
#else
|
||||
send_toggle_verbose ();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
usage ();
|
||||
|
||||
|
Reference in New Issue
Block a user