Commit 1d1b1b00 authored by Nick Schermer's avatar Nick Schermer

* dialogs/mouse-settings/mouse-dialog.glade,

	  dialogs/mouse-settings/main.c,
	  dialogs/mouse-settings/Makefile.am,
	  xfce4-settings-helper/pointers.h,
	  xfce4-settings-helper/pointers.c: Merge multi pointer
	  branch code.
	* dialogs/keyboard-settings/main.c: Release the channels
	  after running the dialog.
	* xfce4-settings-helper/accessx.c, 
	  xfce4-settings-helper/accessx.h,
	  xfce4-settings-helper/xkb.c,
	  xfce4-settings-helper/xkb.h: Move code into objects. Will
	  make things look nice and allows the code to cleanup when
	  the objects are released in main.c.
	* xfce4-settings-helper/main.c: Use the objects and do some
	  more checking before running the dialog.
	* xfce4-settings-helper/accessx.c: Make disabling the mouse
	  keys work; don't call channel_get functions when not needed.
	* dialogs/keyboard-settings/main.c: Release the channels after
	  running the dialog, also destroy the dialog after using it.

(Old svn revision: 27274)
parent 82f323d3
2008-07-13 Nick Schermer <nick@xfce.org>
* dialogs/mouse-settings/mouse-dialog.glade,
dialogs/mouse-settings/main.c,
dialogs/mouse-settings/Makefile.am,
xfce4-settings-helper/pointers.h,
xfce4-settings-helper/pointers.c: Merge multi pointer
branch code.
* dialogs/keyboard-settings/main.c: Release the channels
after running the dialog.
* xfce4-settings-helper/accessx.c,
xfce4-settings-helper/accessx.h,
xfce4-settings-helper/xkb.c,
xfce4-settings-helper/xkb.h: Move code into objects. Will
make things look nice and allows the code to cleanup when
the objects are released in main.c.
* xfce4-settings-helper/main.c: Use the objects and do some
more checking before running the dialog.
* xfce4-settings-helper/accessx.c: Make disabling the mouse
keys work; don't call channel_get functions when not needed.
* dialogs/keyboard-settings/main.c: Release the channels after
running the dialog, also destroy the dialog after using it.
2008-07-11 Nick Schermer <nick@xfce.org> 2008-07-11 Nick Schermer <nick@xfce.org>
* dialogs/mouse-settings/mouse-dialog.glade: Add some tooltips * dialogs/mouse-settings/mouse-dialog.glade: Add some tooltips
......
...@@ -9,8 +9,6 @@ Keyboard settings (Jannis) ...@@ -9,8 +9,6 @@ Keyboard settings (Jannis)
Mouse settings (Nick) Mouse settings (Nick)
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Integrate multi pointer branch. * Fixup some of the Makefiles.
* Make hal and libxcursor an optional dependency. * Add signal watch to xfce4-setting-helper to quit the main loop when
* Check dependency versions of libxi and libxcursor. receiving a sigterm.
* Make it work a bit better with onyl 1 pointer.
* Move the device information into a separate xfconf channel.
dnl dnl
dnl Copyright (c) 2006 dnl Copyright (c) 2006 - 2008
dnl The Xfce development team. All rights reserved. dnl The Xfce development team. All rights reserved.
dnl dnl
dnl Originally written for Xfce by Benedikt Meurer <benny@xfce.org> dnl Originally written for Xfce by Benedikt Meurer <benny@xfce.org>
...@@ -21,52 +21,183 @@ dnl *** Debugging support for SVN snapshots *** ...@@ -21,52 +21,183 @@ dnl *** Debugging support for SVN snapshots ***
dnl ******************************************* dnl *******************************************
m4_define([xfce4_settings_debug_default], [ifelse(xfce4_settings_version_tag(), [svn], [full], [minimum])]) m4_define([xfce4_settings_debug_default], [ifelse(xfce4_settings_version_tag(), [svn], [full], [minimum])])
dnl ***************************
dnl *** Initialize autoconf ***
dnl ***************************
AC_COPYRIGHT([Copyright (c) 2008 AC_COPYRIGHT([Copyright (c) 2008
The Xfce development team. All rights reserved. The Xfce development team. All rights reserved.])
Written for Xfce by Stephan Arts <stephan@xfce.org>.])
AC_INIT([xfce4-settings], [xfce4_settings_version], [http://bugzilla.xfce.org/]) AC_INIT([xfce4-settings], [xfce4_settings_version], [http://bugzilla.xfce.org/])
AC_PREREQ([2.50]) AC_PREREQ([2.50])
AC_REVISION([$Id])
XFCE4_SETTINGS_VERSION=xfce4_settings_version dnl ***************************
AM_INIT_AUTOMAKE([xfce4-settings], [$XFCE4_SETTINGS_VERSION]) dnl *** Initialize automake ***
dnl ***************************
AM_INIT_AUTOMAKE([1.8 dist-bzip2 tar-ustar])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE()
dnl check for UNIX variants dnl *******************************
AC_AIX dnl *** Check for UNIX variants ***
AC_ISC_POSIX dnl *******************************
AC_MINIX AC_AIX()
AM_CONDITIONAL([HAVE_CYGWIN], [test "`uname | grep \"CYGWIN\"`" != ""]) AC_ISC_POSIX()
AC_MINIX()
dnl check for standard header files dnl ********************************
AC_PROG_CC dnl *** Check for basic programs ***
dnl ********************************
AC_PROG_CC()
AC_PROG_LD()
AC_PROG_INSTALL()
AC_PROG_INTLTOOL([0.31], [no-xml]) AC_PROG_INTLTOOL([0.31], [no-xml])
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h math.h stdio.h stdlib.h])
dnl **************************
dnl *** Initialize libtool ***
dnl **************************
AC_PROG_LIBTOOL()
dnl Check for i18n support dnl **********************************
XDT_I18N([@LINGUAS@]) dnl *** Check for standard headers ***
dnl **********************************
AC_CHECK_HEADERS([errno.h memory.h math.h stdlib.h stdio.h string.h unistd.h])
dnl ******************************
dnl *** Check for i18n support ***
dnl ******************************
XDT_I18N([@LINGUAS@])
dnl ***********************************
dnl *** Check for required packages ***
dnl ***********************************
XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.0])
XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.12.0]) XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.12.0])
XDT_CHECK_PACKAGE([GOBJECT], [gobject-2.0], [2.12.0]) XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.12.0])
XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.34])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [0])
XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
XDT_CHECK_PACKAGE([EXO], [exo-0.3], [0.3.0]) XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
XDT_CHECK_OPTIONAL_PACKAGE([GLADE], [libglade-2.0], [2.0.0]) XDT_CHECK_PACKAGE([GLADE], [libglade-2.0], [2.0.0])
XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [0])
XDT_CHECK_PACKAGE([LIBNOTIFY], [libnotify], [0.1.3]) XDT_CHECK_PACKAGE([DBUS_GLIB], [dbus-glib-1], [0.34])
XDT_CHECK_PACKAGE([XI], [xi], [1.1.0])
XDT_CHECK_PACKAGE([LIBX11], [x11], [1.1.0])
dnl check for debugging support
XDT_FEATURE_DEBUG dnl **************************************
dnl *** Optional support for Libnotify ***
dnl **************************************
XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY], [libnotify], [0.1.3],
[libnotify], [Notification support])
dnl ********************************
dnl *** Optional support for HAL ***
dnl ********************************
XDT_CHECK_OPTIONAL_PACKAGE([HAL], [hal], [0.5.0],
[hal], [Hotplugging support])
dnl ************************************
dnl *** Optional support for Xcursor ***
dnl ************************************
XDT_CHECK_OPTIONAL_PACKAGE([XCURSOR], [xcursor], [1.1.0],
[xcursor], [Cursor themes support])
dnl *************************************
dnl *** Optional support for Xf86misc ***
dnl *************************************
XDT_CHECK_OPTIONAL_PACKAGE([XF86MISC], [libxxf86misc], [0.9.0],
[xf86misc], [Support for the X Miscellaneous extension wire protocol])
dnl ***********************************
dnl *** Check for debugging support ***
dnl ***********************************
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes/full@:>@], [Turn on debugging @<:@default=xfce4_settings_debug_default@:>@]),
[], [enable_debug=xfce4_settings_debug_default])
AC_MSG_CHECKING([whether to enable debugging support])
if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Make sure we detect possible errors (if supported)
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall -Werror"
AC_MSG_CHECKING([whether $CC accepts -Wall -Werror])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
PLATFORM_CFLAGS="$PLATFORM_CFLAGS -Wall -Werror"
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
dnl Paranoia for --enable-debug=full
if test x"$enable_debug" = x"full"; then
dnl Enable extensive debugging
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_ENABLE_DEBUG"
dnl Use -O0 -g3 if the compiler supports it
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -O0 -g3"
AC_MSG_CHECKING([whether $CC accepts -O0 -g3])
AC_COMPILE_IFELSE(AC_LANG_SOURCE([int x;]), [
AC_MSG_RESULT([yes])
PLATFORM_CFLAGS="$PLATFORM_CFLAGS -O0 -g3"
], [
AC_MSG_RESULT([no])
])
CFLAGS="$save_CFLAGS"
fi
else
dnl Print the result
AC_MSG_RESULT([$enable_debug])
dnl Disable debugging (release build)
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DNDEBUG"
dnl Disable object cast checks
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_CAST_CHECKS"
dnl Disable all checks for --enable-debug=no
if test x"$enable_debug" = x"no"; then
PLATFORM_CPPFLAGS="$PLATFORM_CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
fi
fi
dnl **************************************
dnl *** Check for linker optimizations ***
dnl **************************************
AC_MSG_CHECKING([whether $LD accepts --as-needed])
case `$LD --as-needed -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
LDFLAGS="$LDFLAGS -Wl,--as-needed"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
AC_MSG_CHECKING([whether $LD accepts -O1])
case `$LD -O1 -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -Wl,-O1"
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
dnl *********************************
dnl *** Substitute platform flags ***
dnl *********************************
AC_MSG_CHECKING([PLATFORM_CPPFLAGS])
AC_MSG_RESULT([$PLATFORM_CPPFLAGS])
AC_SUBST([PLATFORM_CPPFLAGS])
AC_MSG_CHECKING([PLATFORM_CFLAGS])
AC_MSG_RESULT([$PLATFORM_CFLAGS])
AC_SUBST([PLATFORM_CFLAGS])
AC_MSG_CHECKING([PLATFORM_LDFLAGS])
AC_MSG_RESULT([$PLATFORM_LDFLAGS])
AC_SUBST([PLATFORM_LDFLAGS])
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
...@@ -80,9 +211,27 @@ xfce4-settings-helper/Makefile ...@@ -80,9 +211,27 @@ xfce4-settings-helper/Makefile
xfce4-settings-manager/Makefile xfce4-settings-manager/Makefile
]) ])
echo "----------------------------------------" dnl ***************************
echo "$PACKAGE $VERSION" dnl *** Print configuration ***
echo "" dnl ***************************
echo "The binary will be installed in $prefix/bin" echo
echo "" echo "Build Configuration:"
echo "Configure finished, type 'make' to build." echo
echo "* Installation prefix: $prefix"
echo "* Debug Support: $enable_debug"
if test x"$LIBNOTIFY_FOUND" = x"yes"; then
echo "* Libnotify support: yes"
else
echo "* Libnotify support: no"
fi
if test x"$HAL_FOUND" = x"yes"; then
echo "* HAL support: yes"
else
echo "* HAL support: no"
fi
if test x"$XCURSOR_FOUND" = x"yes"; then
echo "* Xcursor support: yes"
else
echo "* Xcursor support: no"
fi
echo
...@@ -479,10 +479,6 @@ keyboard_settings_dialog_new_from_xml (GladeXML *gxml) ...@@ -479,10 +479,6 @@ keyboard_settings_dialog_new_from_xml (GladeXML *gxml)
gtk_widget_show_all(dialog); gtk_widget_show_all(dialog);
gtk_widget_hide(dialog); gtk_widget_hide(dialog);
g_object_unref (xsettings_channel);
g_object_unref (xkb_channel);
g_object_unref (kbd_channel);
return dialog; return dialog;
} }
...@@ -523,6 +519,13 @@ main(int argc, char **argv) ...@@ -523,6 +519,13 @@ main(int argc, char **argv)
/* Create settings dialog and run it */ /* Create settings dialog and run it */
dialog = keyboard_settings_dialog_new_from_xml (gxml); dialog = keyboard_settings_dialog_new_from_xml (gxml);
gtk_dialog_run(GTK_DIALOG(dialog)); gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy (dialog);
g_object_unref (xsettings_channel);
g_object_unref (xkb_channel);
g_object_unref (kbd_channel);
xfconf_shutdown(); xfconf_shutdown();
......
bin_PROGRAMS = xfce4-mouse-settings bin_PROGRAMS = xfce4-mouse-settings
xfce4_mouse_settings_SOURCES = \ xfce4_mouse_settings_SOURCES = \
main.c \ main.c \
mouse-dialog_glade.h mouse-dialog-glade.h
xfce4_mouse_settings_CFLAGS = \ xfce4_mouse_settings_CFLAGS = \
$(GTK_CFLAGS) \ $(GTK_CFLAGS) \
...@@ -10,6 +10,10 @@ xfce4_mouse_settings_CFLAGS = \ ...@@ -10,6 +10,10 @@ xfce4_mouse_settings_CFLAGS = \
$(DBUS_GLIB_CFLAGS) \ $(DBUS_GLIB_CFLAGS) \
$(LIBXFCEGUI4_CFLAGS) \ $(LIBXFCEGUI4_CFLAGS) \
$(XFCONF_CFLAGS) \ $(XFCONF_CFLAGS) \
$(XI_CFLAGS) \
$(XCURSOR_CFLAGS) \
$(HAL_CFLAGS) \
$(XFCONF_CFLAGS) \
-DDATADIR=\"$(datadir)\" \ -DDATADIR=\"$(datadir)\" \
-DSRCDIR=\"$(top_srcdir)\" \ -DSRCDIR=\"$(top_srcdir)\" \
-DLOCALEDIR=\"$(localedir)\" -DLOCALEDIR=\"$(localedir)\"
...@@ -20,7 +24,10 @@ xfce4_mouse_settings_LDADD = \ ...@@ -20,7 +24,10 @@ xfce4_mouse_settings_LDADD = \
$(GLADE_LIBS) \ $(GLADE_LIBS) \
$(DBUS_GLIB_LIBS) \ $(DBUS_GLIB_LIBS) \
$(LIBXFCEGUI4_LIBS) \ $(LIBXFCEGUI4_LIBS) \
$(XFCONF_LIBS) $(XFCONF_LIBS) \
$(HAL_LIBS) \
$(XI_LIBS) \
$(XCURSOR_LIBS)
INCLUDES = \ INCLUDES = \
-I${top_srcdir} \ -I${top_srcdir} \
...@@ -29,9 +36,9 @@ INCLUDES = \ ...@@ -29,9 +36,9 @@ INCLUDES = \
if MAINTAINER_MODE if MAINTAINER_MODE
BUILT_SOURCES = \ BUILT_SOURCES = \
mouse-dialog_glade.h mouse-dialog-glade.h
mouse-dialog_glade.h: mouse-dialog.glade mouse-dialog-glade.h: mouse-dialog.glade
exo-csource --static --name=mouse_dialog_glade $< >$@ exo-csource --static --name=mouse_dialog_glade $< >$@
endif endif
......
This diff is collapsed.
This diff is collapsed.
bin_PROGRAMS = xfce4-settings-helper # $Id$
xfce4_settings_helper_SOURCES = \ INCLUDES = \
main.c \ -I$(top_builddir) \
accessx.c accessx.h \ -I$(top_srcdir) \
xkb.c xkb.h -DBINDIR=\"$(bindir)\" \
-DDATADIR=\"$(datadir)\" \
xfce4_settings_helper_CFLAGS = \ -DG_LOG_DOMAIN=\"Xfce4-settings-helper\" \
$(GTK_CFLAGS) \ -DLIBDIR=\"$(libdir)\" \
$(GLIB_CFLAGS) \ -DLIBEXECDIR=\"$(libexecdir)\" \
$(DBUS_GLIB_CFLAGS) \ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
$(LIBNOTIFY_CFLAGS) \ $(PLATFORM_CPPFLAGS)
$(XFCONF_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \ bin_PROGRAMS = \
-DDATADIR=\"$(datadir)\" \ xfce4-settings-helper
-DSRCDIR=\"$(top_srcdir)\" \
-DLOCALEDIR=\"$(localedir)\" xfce4_settings_helper_SOURCES = \
main.c \
xfce4_settings_helper_LDADD = \ accessx.c \
$(GTK_LIBS) \ accessx.h \
$(GLIB_LIBS) \ xkb.c \
$(DBUS_GLIB_LIBS) \ xkb.h \
$(LIBNOTIFY_LIBS) \ pointers.c \
$(XFCONF_LIBS) \ pointers.h
$(LIBXFCE4UTIL_LIBS)
xfce4_settings_helper_CFLAGS = \
INCLUDES = \ $(GTK_CFLAGS) \
-I$(top_srcdir) $(GLIB_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(DBUS_GLIB_CFLAGS) \
$(XFCONF_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(XI_CFLAGS) \
$(LIBX11_CFLAGS)
xfce4_settings_helper_LDFLAGS = \
-no-undefined \
$(PLATFORM_LDFLAGS)
xfce4_settings_helper_LDADD = \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(GTHREAD_LIBS) \
$(DBUS_GLIB_LIBS) \
$(XFCONF_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(XI_LIBS) \
$(LIBX11_LIBS)
if HAVE_LIBNOTIFY
xfce4_settings_helper_CFLAGS += \
$(LIBNOTIFY_CFLAGS)
xfce4_settings_helper_LDADD += \
$(LIBNOTIFY_LIBS)
endif
if HAVE_HAL
xfce4_settings_helper_CFLAGS += \
$(HAL_CFLAGS)
xfce4_settings_helper_LDADD += \
$(HAL_LIBS)
endif
clean-local:
rm -f *.core core core.*
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
...@@ -28,236 +28,355 @@ ...@@ -28,236 +28,355 @@
#endif #endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/XKBlib.h> #include <X11/XKBlib.h>
#ifdef HAVE_XF86MISC
#include <X11/extensions/xf86misc.h>
#endif
#include <glib.h> #include <glib.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#include <libxfce4util/libxfce4util.h>
#include <xfconf/xfconf.h> #include <xfconf/xfconf.h>
#include <libxfce4util/libxfce4util.h>
#ifdef HAVE_LIBNOTIFY
#include <libnotify/notify.h> #include <libnotify/notify.h>
#endif /* !HAVE_LIBNOTIFY */
#include <xfce4-settings-helper/accessx.h>
#include "xkb.h"
static NotifyNotification *accessx_notification = NULL;
static XfconfChannel *accessx_channel; static void xfce_accessx_helper_class_init (XfceAccessxHelperClass *klass);
static void xfce_accessx_helper_init (XfceAccessxHelper *helper);
static void xfce_accessx_helper_finalize (GObject *object);
static void xfce_accessx_helper_set_xkb (XfceAccessxHelper *helper);
static void xfce_accessx_helper_channel_property_changed (XfconfChannel *channel,
const gchar *property_name,
const GValue *value,
XfceAccessxHelper *helper);
#ifdef HAVE_LIBNOTIFY
static GdkFilterReturn xfce_accessx_helper_event_filter (GdkXEvent *xevent,
GdkEvent *gdk_event,
gpointer user_data);
static void xfce_accessx_helper_notification_closed (NotifyNotification *notification,
XfceAccessxHelper *helper);
static void xfce_accessx_helper_notification_show (XfceAccessxHelper *helper,
const gchar *summary,
const gchar *body);
#endif /* !HAVE_LIBNOTIFY */
struct _XfceAccessxHelperClass
{
GObjectClass __parent__;
};
struct _XfceAccessxHelper
{
GObject __parent__;
/* xfconf channel */
XfconfChannel *channel;
#ifdef HAVE_LIBNOTIFY
NotifyNotification *notification;
#endif /* !HAVE_LIBNOTIFY */
};
G_DEFINE_TYPE (XfceAccessxHelper, xfce_accessx_helper, G_TYPE_OBJECT);
static gboolean accessx_initialized = FALSE;
static void static void
toggle_accessx (XfconfChannel *channel); xfce_accessx_helper_class_init (XfceAccessxHelperClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = xfce_accessx_helper_finalize;
}
GdkFilterReturn
accessx_event_filter (GdkXEvent *xevent, static void
GdkEvent *g_event, xfce_accessx_helper_init (XfceAccessxHelper *helper)
gpointer data)
{ {
XkbEvent *event = xevent; gint dummy;
switch(event->any.xkb_type) helper->channel = NULL;
#ifdef HAVE_LIBNOTIFY
helper->notification = NULL;
#endif /* !HAVE_LIBNOTIFY */
if (XkbQueryExtension (GDK_DISPLAY (), &dummy, &dummy, &dummy, &dummy, &dummy))
{ {
case XkbBellNotify: /* open the channel */
break; helper->channel = xfconf_channel_new ("accessx");
case XkbControlsNotify:
{ /* monitor channel changes */
if(event->ctrls.enabled_ctrl_changes & XkbStickyKeysMask) g_signal_connect (G_OBJECT (helper->channel), "property-changed", G_CALLBACK (xfce_accessx_helper_channel_property_changed), helper);
{
if(event->ctrls.enabled_ctrls & XkbStickyKeysMask) /* restore the xbd configuration */
{ xfce_accessx_helper_set_xkb (helper);
notify_notification_update(accessx_notification,
_("Sticky keys"), #ifdef HAVE_LIBNOTIFY
_("Sticky keys are enabled"), /* setup a connection with the notification daemon */
"keyboard"); if (!notify_init ("xfce4-settings-helper"))
} g_critical ("Failed to connect to the notification daemon.");
else
{ /* add event filter */
notify_notification_update(accessx_notification, XkbSelectEvents (GDK_DISPLAY (), XkbUseCoreKbd, XkbControlsNotifyMask, XkbControlsNotifyMask);
_("Sticky keys"),
_("Sticky keys are disabled"), /* monitor all window events */
"keyboard"); gdk_window_add_filter (NULL, xfce_accessx_helper_event_filter, helper);
} #endif /* !HAVE_LIBNOTIFY */
}
notify_notification_show(accessx_notification, NULL); else
} {
/* warning */