summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Smith <msmith@cbnco.com>2011-01-15 18:30:47 -0500
committerThomas Thurman <tthurman@gnome.org>2011-01-15 18:30:47 -0500
commitfbb61a9db6b1806043a4522f7fa3843508113ea3 (patch)
tree6fbaf2d302dd1b0230543b5842d6dda6198101f2
parent5389959edc3372fe43caf2230f6922c35c8b04e6 (diff)
downloadmetacity-fbb61a9db6b1806043a4522f7fa3843508113ea3.tar.gz
configure.in: add flag to disable canberra. Fixes #634360.
For embedded builds, it'd be nice to be able to disable canberra. Canberra is still enabled by default.
-rw-r--r--configure.in13
-rw-r--r--src/core/bell.c10
-rw-r--r--src/core/workspace.c5
3 files changed, 26 insertions, 2 deletions
diff --git a/configure.in b/configure.in
index 1b971f7b..4138ede4 100644
--- a/configure.in
+++ b/configure.in
@@ -129,7 +129,7 @@ case "$with_gtk" in
;;
esac
-METACITY_PC_MODULES="gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION pango >= 1.2.0 $CANBERRA_GTK"
+METACITY_PC_MODULES="gtk+-$GTK_API_VERSION >= $GTK_MIN_VERSION pango >= 1.2.0"
AC_SUBST(GTK_API_VERSION)
AC_ARG_ENABLE(gconf,
@@ -142,6 +142,16 @@ if test x$enable_gconf = xyes; then
METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
fi
+AC_ARG_ENABLE(canberra,
+ AC_HELP_STRING([--disable-canberra],
+ [disable use of canberra for event sounds, for embedded non-GNOME builds]),,
+ enable_canberra=yes)
+
+if test x$enable_canberra = xyes; then
+ AC_DEFINE(HAVE_CANBERRA,1,[Build with canberra support])
+ METACITY_PC_MODULES="$METACITY_PC_MODULES $CANBERRA_GTK"
+fi
+
AC_ARG_ENABLE(verbose-mode,
AC_HELP_STRING([--disable-verbose-mode],
[disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds]),,
@@ -570,6 +580,7 @@ metacity-$VERSION (using gtk+-${GTK_API_VERSION}):
compiler: ${CC}
GConf: ${enable_gconf}
+ Canberra: ${enable_canberra}
XFree86 Xinerama: ${use_xfree_xinerama}
Solaris Xinerama: ${use_solaris_xinerama}
Startup notification: ${have_startup_notification}
diff --git a/src/core/bell.c b/src/core/bell.c
index 87d8fa09..e54de740 100644
--- a/src/core/bell.c
+++ b/src/core/bell.c
@@ -52,7 +52,10 @@
#include "bell.h"
#include "screen-private.h"
#include "prefs.h"
+
+#ifdef HAVE_CANBERRA
#include <canberra-gtk.h>
+#endif
/**
* Flashes one entire screen. This is done by making a window the size of the
@@ -284,8 +287,10 @@ meta_bell_notify (MetaDisplay *display,
if (meta_prefs_bell_is_audible ())
{
- ca_proplist *p;
XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent*) xkb_ev;
+
+#ifdef HAVE_CANBERRA
+ ca_proplist *p;
MetaWindow *window;
int res;
@@ -312,6 +317,9 @@ meta_bell_notify (MetaDisplay *display,
ca_proplist_destroy (p);
if (res != CA_SUCCESS && res != CA_ERROR_DISABLED)
+#else
+ if (1)
+#endif /* HAVE_CANBERRA */
{
/* ...and in case that failed we use the classic X11 bell. */
XkbForceDeviceBell (display->xdisplay,
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 063f867c..12798a55 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -29,7 +29,10 @@
#include "prefs.h"
#include <X11/Xatom.h>
#include <string.h>
+
+#ifdef HAVE_CANBERRA
#include <canberra-gtk.h>
+#endif
void meta_workspace_queue_calc_showing (MetaWorkspace *workspace);
static void set_active_space_hint (MetaScreen *screen);
@@ -355,11 +358,13 @@ static void workspace_switch_sound(MetaWorkspace *from,
goto finish;
}
+#ifdef HAVE_CANBERRA
ca_context_play(ca_gtk_context_get(), 1,
CA_PROP_EVENT_ID, e,
CA_PROP_EVENT_DESCRIPTION, "Desktop switched",
CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
NULL);
+#endif
finish:
meta_screen_free_workspace_layout (&layout);