Commit a228546d authored by Florian Müllner's avatar Florian Müllner

Port preferences to GSettings

Move preferences to GSettings, using mainly shared schemas from
gsettings-desktop-schemas.

Unlike GConf, GSettings support is not optional, as Gio is already
a hard dependency of GTK+.

Based on an initial patch from Milan Bouchet-Valat.

https://bugzilla.gnome.org/show_bug.cgi?id=621204
parent 65f45904
......@@ -177,8 +177,8 @@ src/metacity
src/metacity-theme-viewer
src/metacity-wm.desktop
src/metacity.desktop
src/metacity.schemas
src/metacity.schemas.in
src/org.gnome.metacity.gschema.valid
src/org.gnome.metacity.gschema.xml
src/place.o
src/prefs.o
src/resizepopup.o
......
......@@ -42,10 +42,10 @@ Minimal Building/Testing Environment
build a development version of Metacity -- odds are, you may be able
to build metacity from CVS without building any other modules.
As long as you have gtk+ >= 2.10 and GConf with your distro (gtk+ >=
2.6 if you manually revert the change from bug 348633), you should
be able to install your distro's development packages
(e.g. gtk2-devel, GConf2-devel, startup-notification-devel on
As long as you have gtk+ >= 2.10 and GIO >= 2.25.10 with your distro
(gtk+ >= 2.6 if you manually revert the change from bug 348633), you
should be able to install your distro's development packages
(e.g. gtk2-devel, glib-devel, startup-notification-devel on
Fedora; also, remember to install the gnome-common package which is
needed for building cvs versions of Gnome modules like Metacity) as
well as the standard development tools (gcc, autoconf, automake,
......
......@@ -18,8 +18,7 @@ COMPILING METACITY
You need GTK+ 2.2. For startup notification to work you need
libstartup-notification at
http://www.freedesktop.org/software/startup-notification/ or on the
GNOME ftp site. You also need GConf 1.2 (unless building a funky
extra-small embedded metacity with --disable-gconf, see below).
GNOME ftp site.
REPORTING BUGS AND SUBMITTING PATCHES
===
......@@ -48,7 +47,6 @@ the theme engine.
You can strip about 70K from the metacity binary by compiling with
options such as:
--disable-gconf
--disable-sm
--disable-verbose-mode
--disable-startup-notification
......@@ -94,25 +92,24 @@ METACITY FEATURES
and should work with KWin, fvwm2, and other EWMH-compliant WMs.)
- Has a simple theme system and a couple of extra themes come with it.
Change themes via gconf-editor or gconftool or GNOME themes control
panel:
gconftool-2 --type=string --set /apps/metacity/general/theme Crux
gconftool-2 --type=string --set /apps/metacity/general/theme Gorilla
gconftool-2 --type=string --set /apps/metacity/general/theme Atlanta
gconftool-2 --type=string --set /apps/metacity/general/theme Bright
Change themes via gsettings:
gsettings set org.gnome.desktop.wm.preferences theme Crux
gsettings set org.gnome.desktop.wm.preferences theme Gorilla
gsettings set org.gnome.desktop.wm.preferences theme Atlanta
gsettings set org.gnome.desktop.wm.preferences theme Bright
See theme-format.txt for docs on the theme format. Use
metacity-theme-viewer to preview themes.
- Change number of workspaces via gconf-editor or gconftool:
gconftool-2 --type=int --set /apps/metacity/general/num_workspaces 5
- Change number of workspaces via gsettings:
gsettings set org.gnome.desktop.wm.preferences num-workspaces 5
Can also change workspaces from GNOME 2 pager.
- Change focus mode:
gconftool-2 --type=string --set /apps/metacity/general/focus_mode mouse
gconftool-2 --type=string --set /apps/metacity/general/focus_mode sloppy
gconftool-2 --type=string --set /apps/metacity/general/focus_mode click
gsettings set org.gnome.desktop.wm.preferences focus-mode mouse
gsettings set org.gnome.desktop.wm.preferences focus-mode sloppy
gsettings set org.gnome.desktop.wm.preferences focus-mode click
- Global keybinding defaults include:
......@@ -127,12 +124,9 @@ METACITY FEATURES
Change keybindings for example:
unst gconftool-2 --type=string --set /apps/metacity/global_keybindings/switch_to_workspace_1 '<Alt>F1'
gsettings set org.gnome.desktop.wm.keybindings switch_to_workspace_1 '<Alt>F1'
Also try the GNOME keyboard shortcuts control panel, or
gconf-editor.
See metacity.schemas for all available bindings.
Also try the GNOME keyboard shortcuts control panel.
- Window keybindings:
......
......@@ -113,20 +113,13 @@ dnl work; see https://bugzilla.gnome.org/show_bug.cgi?id=650513
with_gtk=2.0
GTK_API_VERSION=2.0
GTK_MIN_VERSION=2.20.0
GIO_MIN_VERSION=2.25.10
CANBERRA_GTK=libcanberra-gtk
METACITY_PC_MODULES="gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION pango >= 1.2.0"
METACITY_PC_MODULES="gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION gio-2.0 >= $GIO_MIN_VERSION pango >= 1.2.0 gsettings-desktop-schemas"
AC_SUBST(GTK_API_VERSION)
AC_ARG_ENABLE(gconf,
AC_HELP_STRING([--disable-gconf],
[disable gconf usage, for embedded/size-sensitive non-GNOME builds]),,
enable_gconf=yes)
if test x$enable_gconf = xyes; then
AC_DEFINE(HAVE_GCONF,1,[Build with gconf support])
METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
fi
GLIB_GSETTINGS
AC_ARG_ENABLE(canberra,
AC_HELP_STRING([--disable-canberra],
......@@ -492,18 +485,6 @@ fi
AC_SUBST(GDK_PIXBUF_CSOURCE)
if test x$enable_gconf = xyes; then
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test x"$GCONFTOOL" = xno; then
AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
fi
AM_GCONF_SOURCE_2
else
GCONF_SCHEMAS_INSTALL_TRUE='#'
GCONF_SCHEMAS_INSTALL_FALSE=
fi
AC_PATH_PROG(ZENITY, zenity, no)
if test x"$ZENITY" = xno; then
AC_MSG_ERROR([zenity not found in your path - needed for dialogs])
......@@ -539,13 +520,6 @@ po/Makefile.in
AC_OUTPUT
if test x$enable_gconf = xno; then
echo "*** WARNING WARNING WARNING WARNING WARNING"
echo "*** Building without GConf. This means there's no"
echo "*** way to change prefs except hacking source code."
echo "*** This is intended for embedded systems etc., not for normal use."
fi
if test x$enable_verbose_mode = xno; then
echo "*** WARNING WARNING WARNING WARNING WARNING"
echo "*** Building without verbose mode"
......@@ -562,7 +536,6 @@ metacity-$VERSION (using gtk+-${GTK_API_VERSION}):
source code location: ${srcdir}
compiler: ${CC}
GConf: ${enable_gconf}
Canberra: ${enable_canberra}
XFree86 Xinerama: ${use_xfree_xinerama}
Solaris Xinerama: ${use_solaris_xinerama}
......
......@@ -7,14 +7,14 @@ To turn the compositor on initially, you need to pass --enable-compositor to
the configure script. This will introduce a dependence on libcm, which you
can get from <URL:http://ftp.gnome.org/pub/GNOME/sources/libcm/>.
When Metacity is compiled, you will need to turn the compositor on in gconf
When Metacity is compiled, you will need to turn the compositor on in gsettings
for it to have any effect. You will find the boolean switch at
/apps/metacity/general/compositing_manager
org.gnome.metacity compositing-manager
When that's done, you can set some environment variables before you launch
Metacity to influence how the compositor works. These will eventually become
configuration options or gconf options when they grow up. Define them to any
configuration options or gsettings options when they grow up. Define them to any
value to turn them on; leave them undefined to turn them off. Currently the
options you can set are:
......
......@@ -266,9 +266,9 @@ for a theme installed for all users.</para></listitem>
<para>When you're editing a theme, you can view it without using it on the whole desktop using
<command>metacity-theme-viewer YourThemeName</command></para>
<para>and view it on the whole desktop using
<command>gconftool -<!-- x -->-type=string -<!-- x -->-set /apps/metacity/general/theme YourThemeName</command></para>
<command>gsettings set org.gnome.desktop.wm.preferences theme YourThemeName</command></para>
<para>Whenever you change the selected theme in GConf, Metacity will load the newly-chosen theme. This is how control-center does it. But when you change a theme, as you're working on it, you might want to ask Metacity to reload the theme which is currently used on the whole desktop to reflect your changes. You can do this using the little-known <command>metacity-message</command> program, with the command <literal>metacity-message reload-theme</literal>. This works by sending the ClientMessage <literal>_METACITY_RELOAD_THEME_MESSAGE</literal> to the root window, in case you're interested.</para>
<para>Whenever you change the selected theme in GSettings, Metacity will load the newly-chosen theme. This is how control-center does it. But when you change a theme, as you're working on it, you might want to ask Metacity to reload the theme which is currently used on the whole desktop to reflect your changes. You can do this using the little-known <command>metacity-message</command> program, with the command <literal>metacity-message reload-theme</literal>. This works by sending the ClientMessage <literal>_METACITY_RELOAD_THEME_MESSAGE</literal> to the root window, in case you're interested.</para>
<para>Once you're done with your theme, consider submitting it to <ulink url="http://art.gnome.org/themes/metacity/">the art.gnome.org site</ulink>, or <ulink url="http://www.gnome-look.org/index.php?xcontentmode=101">the gnome-look site</ulink>.</para>
......
......@@ -46,13 +46,13 @@ because the original program does not have a manual page.
Restart \fBmetacity\fP(1) which is running.
.TP
.B reload-theme
Reload a theme which is specified on gconf database.
Reload a theme which is specified on gsettings database.
.TP
.B enable-keybindings
Enable all of keybindings which is specified on gconf database.
Enable all of keybindings which is specified on gsettings database.
.TP
.B disable-keybindings
Disable all of keybindings which is specified on gconf database.
Disable all of keybindings which is specified on gsettings database.
.SH SEE ALSO
.BR metacity (1)
.SH AUTHOR
......
......@@ -51,7 +51,7 @@ Print the version number.
.B \-?, \-\-help
Show summary of options.
.SH CONFIGURATION
\fBmetacity\fP configuration can be found under \fIPreferences\fP->\fIWindows\fP and \fIPreferences\fP->\fIKeyboard Shortcuts\fP on the menu-panel. Advanced configuration can be achieved directly through gconf editing (gconf-editor or gconftool-2).
\fBmetacity\fP configuration can be found under \fIPreferences\fP->\fIWindows\fP and \fIPreferences\fP->\fIKeyboard Shortcuts\fP on the menu-panel. Advanced configuration can be achieved directly through gsettings.
.SH SEE ALSO
.BR metacity-message (1)
.SH AUTHOR
......
......@@ -14,22 +14,20 @@ src/core/keybindings.c
src/core/main.c
src/core/prefs.c
src/core/screen.c
src/core/schema-bindings.c
src/core/session.c
src/core/util.c
src/core/window.c
src/core/window-props.c
src/core/window.c
src/core/xprops.c
src/include/all-keybindings.h
src/metacity.desktop.in
src/metacity.schemas.in.in
src/metacity-wm.desktop.in
src/metacity.desktop.in
src/org.gnome.metacity.gschema.xml.in
src/tools/metacity-message.c
src/ui/frames.c
src/ui/menu.c
src/ui/metaaccellabel.c
src/ui/resizepopup.c
src/ui/theme.c
src/ui/theme-parser.c
src/ui/theme-viewer.c
src/ui/theme.c
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries group="system" _name="Launchers" wm_name="Metacity" package="metacity">
<KeyListEntry
name="/apps/metacity/global_keybindings/run_command_terminal" />
</KeyListEntries>
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries group="system" _name="Navigation" wm_name="Metacity" package="metacity">
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_1"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_2"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_3"
value="2"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_4"
value="3"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_5"
value="4"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_6"
value="5"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_7"
value="6"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_8"
value="7"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_9"
value="8"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_10"
value="9"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_11"
value="10"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_12"
value="11"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_left"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_right"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_up"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/window_keybindings/move_to_workspace_down"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_windows" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_group" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_panels" />
<KeyListEntry
name="/apps/metacity/global_keybindings/cycle_windows" />
<KeyListEntry
name="/apps/metacity/global_keybindings/cycle_group" />
<KeyListEntry
name="/apps/metacity/global_keybindings/cycle_panels" />
<KeyListEntry
name="/apps/metacity/global_keybindings/show_desktop" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_1"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_2"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_3"
value="2"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_4"
value="3"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_5"
value="4"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_6"
value="5"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_7"
value="6"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_8"
value="7"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_9"
value="8"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_10"
value="9"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_11"
value="10"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_12"
value="11"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_left"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_right"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_up"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntry
name="/apps/metacity/global_keybindings/switch_to_workspace_down"
value="1"
key="/apps/metacity/general/num_workspaces"
comparison="gt" />
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="Navigation"
wm_name="Metacity"
package="gsettings-desktop-schemas">
</KeyListEntries>
<KeyListEntry name="move-to-workspace-1"
_description="Move window to workspace 1" />
<KeyListEntry name="move-to-workspace-2"
_description="Move window to workspace 2" />
<KeyListEntry name="move-to-workspace-3"
_description="Move window to workspace 3" />
<KeyListEntry name="move-to-workspace-4"
_description="Move window to workspace 4" />
<KeyListEntry name="move-to-workspace-left"
_description="Move window one workspace to the left" />
<KeyListEntry name="move-to-workspace-right"
_description="Move window one workspace to the right" />
<KeyListEntry name="move-to-workspace-up"
_description="Move window one workspace up" />
<KeyListEntry name="move-to-workspace-down"
_description="Move window one workspace down" />
<KeyListEntry name="switch-windows"
_description="Switch applications"/>
<KeyListEntry name="switch-group"
_description="Switch windows of an application"/>
<KeyListEntry name="switch-panels"
_description="Switch system controls"/>
<KeyListEntry name="cycle-windows"
_description="Switch windows directly"/>
<KeyListEntry name="cycle-group"
_description="Switch windows of an app directly"/>
<KeyListEntry name="cycle-panels"
_description="Switch system controls directly"/>
<KeyListEntry name="show-desktop"
_description="Hide all normal windows"/>
<KeyListEntry name="switch-to-workspace-1"
_description="Switch to workspace 1" />
<KeyListEntry name="switch-to-workspace-2"
_description="Switch to workspace 2" />
<KeyListEntry name="switch-to-workspace-3"
_description="Switch to workspace 3" />
<KeyListEntry name="switch-to-workspace-4"
_description="Switch to workspace 4" />
<KeyListEntry name="switch-to-workspace-left"
_description="Move to workspace left" />
<KeyListEntry name="switch-to-workspace-right"
_description="Move to workspace right" />
<KeyListEntry name="switch-to-workspace-up"
_description="Move to workspace above" />
<KeyListEntry name="switch-to-workspace-down"
_description="Move to workspace below" />
</KeyListEntries>
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries group="system" _name="Screenshots" wm_name="Metacity" package="metacity">
<KeyListEntry
name="/apps/metacity/global_keybindings/run_command_screenshot" />
<KeyListEntry
name="/apps/metacity/global_keybindings/run_command_window_screenshot" />
</KeyListEntries>
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries group="system" _name="System" wm_name="Metacity" package="metacity">
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="System"
wm_name="Metacity"
package="gsettings-desktop-schemas">
<KeyListEntry
name="/apps/metacity/global_keybindings/panel_run_dialog" />
<KeyListEntry name="panel-run-dialog" _description="Show the run command prompt"/>
<KeyListEntry
name="/apps/metacity/global_keybindings/panel_main_menu" />
<KeyListEntry name="panel-main-menu" _description="Show the activities overview"/>
</KeyListEntries>
<?xml version="1.0" encoding="UTF-8" ?>
<KeyListEntries group="system" _name="Windows" wm_name="Metacity" package="metacity">
<KeyListEntries schema="org.gnome.desktop.wm.keybindings"
group="system"
_name="Windows"
wm_name="Metacity"
package="gsettings-desktop-schemas">
<KeyListEntry
name="/apps/metacity/window_keybindings/activate_window_menu" />
<KeyListEntry name="activate-window-menu" _description="Activate the window menu"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/toggle_fullscreen" />
<KeyListEntry name="toggle-fullscreen" _description="Toggle fullscreen mode"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/toggle_maximized" />
<KeyListEntry name="toggle-maximized" _description="Toggle maximization state"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/maximize" />
<KeyListEntry name="maximize" _description="Maximize window"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/unmaximize" />
<KeyListEntry name="unmaximize" _description="Restore window"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/toggle_shaded" />
<KeyListEntry name="toggle-shaded" _description="Toggle shaded state"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/close" />
<KeyListEntry name="close" _description="Close window"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/minimize" />
<KeyListEntry name="minimize" _description="Minimize window"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/begin_move" />
<KeyListEntry name="begin-move" _description="Move window"/>
<KeyListEntry
name="/apps/metacity/window_keybindings/begin_resize" />
<KeyListEntry name="begin-resize" _description="Resize window"/>
<KeyListEntry