static guint _signal_retrieve_surrounding_id = 0;
static const gchar * const _no_snooper_apps = NO_SNOOPER_APPS;
-static gboolean _use_key_snooper = TRUE;
+static gboolean _use_key_snooper = ENABLE_SNOOPER;
static GtkIMContext *_focus_im_context = NULL;
g_signal_lookup ("retrieve-surrounding", G_TYPE_FROM_CLASS (klass));
g_assert (_signal_retrieve_surrounding_id != 0);
- if (g_getenv ("IBUS_DISABLE_SNOOPER") != NULL) {
- /* disable snooper if env IBUS_DISABLE_SNOOPER is set */
- _use_key_snooper = FALSE;
- }
- else {
- /* disable snooper if app is in _no_snooper_apps */
- gchar ** apps = g_strsplit (_no_snooper_apps, ",", 0);
- gchar **p;
- for (p = apps; *p != NULL; p++) {
- if (g_strcmp0 (*p, g_get_application_name ()) == 0) {
- _use_key_snooper = FALSE;
- break;
+ if (_use_key_snooper) {
+ if (g_getenv ("IBUS_DISABLE_SNOOPER") != NULL) {
+ /* disable snooper if env IBUS_DISABLE_SNOOPER is set */
+ _use_key_snooper = FALSE;
+ }
+ else {
+ /* disable snooper if app is in _no_snooper_apps */
+ const gchar * prgname = g_get_prgname ();
+ gchar ** apps = g_strsplit (_no_snooper_apps, ",", 0);
+ gchar **p;
+ for (p = apps; *p != NULL; p++) {
+ if (g_strcmp0 (*p, prgname) == 0) {
+ _use_key_snooper = FALSE;
+ break;
+ }
}
+ g_strfreev (apps);
}
- g_strfreev (apps);
}
if (_use_key_snooper) {
AS_HELP_STRING([--disable-dbus-python-check],
[Do not check dbus-python]),
[enable_dbus_python_check=$enableval],
- [enable_dbus_python_check=yes],
+ [enable_dbus_python_check=yes]
)
PKG_CHECK_MODULES(DBUS_PYTHON,
[dbus-python >= 0.83.0],
fi
fi
+# option for disable snooper applications
+AC_ARG_ENABLE(key-snooper,
+ AS_HELP_STRING([--disable-key-snooper],
+ [Disable key snooper in gtk im module]),
+ [enable_key_snooper=$enableval],
+ [enable_key_snooper=yes]
+)
+if test x"$enable_key_snooper" != x"no"; then
+ AC_DEFINE(ENABLE_SNOOPER, TRUE, [Enable key snooper])
+else
+ AC_DEFINE(ENABLE_SNOOPER, FALSE, [Enable key snooper])
+fi
+
# option for no snooper applications
AC_ARG_WITH(no-snooper-apps,
AS_HELP_STRING([--with-no-snooper-apps[=app1,app2]],
NO_SNOOPER_APPS=$with_no_snooper_apps
)
AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
- [Does not enbale snooper in thos applications])
+ [Does not enbale key snooper in those applications])
# check iso-codes
PKG_CHECK_MODULES(ISOCODES, [
AC_OUTPUT
AC_MSG_RESULT([
Build options:
- Version $VERSION
- Install prefix $prefix
- Build shared libs $enable_shared
- Build static libs $enable_static
- Gtk immodule dir $GTK_IM_MODULEDIR
- Build python modules $enable_python
- Build gconf modules $enable_gconf
- Build document $enable_gtk_doc
+ Version $VERSION
+ Install prefix $prefix
+ Build shared libs $enable_shared
+ Build static libs $enable_static
+ Gtk immodule dir $GTK_IM_MODULEDIR
+ Build python modules $enable_python
+ Build gconf modules $enable_gconf
+ Build document $enable_gtk_doc
+ Enable key snooper $enable_key_snooper
+ No snooper apps "$NO_SNOOPER_APPS"
])