Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
/* Mutter send-magic-messages app */
|
2002-02-08 01:01:58 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2002 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.
|
|
|
|
*/
|
|
|
|
|
2002-12-08 14:17:17 -05:00
|
|
|
#include <config.h>
|
2002-02-08 01:01:58 -05:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdkx.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2002-12-08 14:17:17 -05:00
|
|
|
#include <libintl.h>
|
|
|
|
#define _(x) dgettext (GETTEXT_PACKAGE, x)
|
|
|
|
#define N_(x) x
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
static Display *display;
|
2002-12-08 14:17:17 -05:00
|
|
|
|
2002-02-08 01:01:58 -05:00
|
|
|
static void
|
|
|
|
send_reload_theme (void)
|
|
|
|
{
|
|
|
|
XEvent xev;
|
|
|
|
|
|
|
|
xev.xclient.type = ClientMessage;
|
|
|
|
xev.xclient.serial = 0;
|
|
|
|
xev.xclient.send_event = True;
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.display = display;
|
2002-02-08 01:01:58 -05:00
|
|
|
xev.xclient.window = gdk_x11_get_default_root_xwindow ();
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.message_type = XInternAtom (display,
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
"_MUTTER_RELOAD_THEME_MESSAGE",
|
2002-02-08 01:01:58 -05:00
|
|
|
False);
|
|
|
|
xev.xclient.format = 32;
|
|
|
|
xev.xclient.data.l[0] = 0;
|
|
|
|
xev.xclient.data.l[1] = 0;
|
|
|
|
xev.xclient.data.l[2] = 0;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XSendEvent (display,
|
2002-02-08 01:01:58 -05:00
|
|
|
gdk_x11_get_default_root_xwindow (),
|
|
|
|
False,
|
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
|
|
|
&xev);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XFlush (display);
|
|
|
|
XSync (display, False);
|
2002-02-08 01:01:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
send_set_keybindings (gboolean enabled)
|
|
|
|
{
|
|
|
|
XEvent xev;
|
|
|
|
|
|
|
|
xev.xclient.type = ClientMessage;
|
|
|
|
xev.xclient.serial = 0;
|
|
|
|
xev.xclient.send_event = True;
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.display = display;
|
2002-02-08 01:01:58 -05:00
|
|
|
xev.xclient.window = gdk_x11_get_default_root_xwindow ();
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.message_type = XInternAtom (display,
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
"_MUTTER_SET_KEYBINDINGS_MESSAGE",
|
2002-02-08 01:01:58 -05:00
|
|
|
False);
|
|
|
|
xev.xclient.format = 32;
|
|
|
|
xev.xclient.data.l[0] = enabled;
|
|
|
|
xev.xclient.data.l[1] = 0;
|
|
|
|
xev.xclient.data.l[2] = 0;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XSendEvent (display,
|
2002-02-08 01:01:58 -05:00
|
|
|
gdk_x11_get_default_root_xwindow (),
|
|
|
|
False,
|
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
|
|
|
&xev);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XFlush (display);
|
|
|
|
XSync (display, False);
|
2002-02-08 01:01:58 -05:00
|
|
|
}
|
|
|
|
|
2002-12-08 14:17:17 -05:00
|
|
|
#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;
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.display = display;
|
2002-12-08 14:17:17 -05:00
|
|
|
xev.xclient.window = gdk_x11_get_default_root_xwindow ();
|
2010-09-10 03:17:55 -04:00
|
|
|
xev.xclient.message_type = XInternAtom (display,
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
"_MUTTER_TOGGLE_VERBOSE",
|
2002-12-08 14:17:17 -05:00
|
|
|
False);
|
|
|
|
xev.xclient.format = 32;
|
|
|
|
xev.xclient.data.l[0] = 0;
|
|
|
|
xev.xclient.data.l[1] = 0;
|
|
|
|
xev.xclient.data.l[2] = 0;
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XSendEvent (display,
|
2002-12-08 14:17:17 -05:00
|
|
|
gdk_x11_get_default_root_xwindow (),
|
|
|
|
False,
|
|
|
|
SubstructureRedirectMask | SubstructureNotifyMask,
|
|
|
|
&xev);
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
XFlush (display);
|
|
|
|
XSync (display, False);
|
2002-12-08 14:17:17 -05:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-02-08 01:01:58 -05:00
|
|
|
static void
|
|
|
|
usage (void)
|
|
|
|
{
|
2002-12-08 14:17:17 -05:00
|
|
|
g_printerr (_("Usage: %s\n"),
|
2011-03-07 10:30:51 -05:00
|
|
|
"mutter-message (reload-theme|enable-keybindings|disable-keybindings|toggle-verbose)");
|
2002-02-08 01:01:58 -05:00
|
|
|
exit (1);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
2003-09-30 15:59:15 -04:00
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
|
|
|
2002-02-08 01:01:58 -05:00
|
|
|
gtk_init (&argc, &argv);
|
|
|
|
|
|
|
|
if (argc < 2)
|
|
|
|
usage ();
|
|
|
|
|
2010-09-10 03:17:55 -04:00
|
|
|
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
|
|
|
|
|
2011-03-07 10:30:51 -05:00
|
|
|
if (strcmp (argv[1], "reload-theme") == 0)
|
2002-02-08 01:01:58 -05:00
|
|
|
send_reload_theme ();
|
|
|
|
else if (strcmp (argv[1], "enable-keybindings") == 0)
|
|
|
|
send_set_keybindings (TRUE);
|
|
|
|
else if (strcmp (argv[1], "disable-keybindings") == 0)
|
|
|
|
send_set_keybindings (FALSE);
|
2002-12-08 14:17:17 -05:00
|
|
|
else if (strcmp (argv[1], "toggle-verbose") == 0)
|
|
|
|
{
|
|
|
|
#ifndef WITH_VERBOSE_MODE
|
Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.
The overall version was brought up to 2.27 to match current gnome.
Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system. Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap. These files will eventually end up in an external
gnome-wm-data module.
Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.
Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set. This allows
gnome-control-center to continue using libmetacity.so for
configuration. This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-10 06:29:20 -04:00
|
|
|
g_printerr (_("Mutter was compiled without support for verbose mode\n"));
|
2002-12-08 14:17:17 -05:00
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
send_toggle_verbose ();
|
|
|
|
#endif
|
|
|
|
}
|
2002-02-08 01:01:58 -05:00
|
|
|
else
|
|
|
|
usage ();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|