Index: plugins/display_plugin/display_plugin.c =================================================================== --- plugins/display_plugin/display_plugin.c (revision 26001) +++ plugins/display_plugin/display_plugin.c (working copy) @@ -28,11 +28,11 @@ #include #include #include -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR #include #include #endif -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM #include #endif @@ -74,7 +74,7 @@ static int greenValue = 100; static int blueValue = 100; static gboolean syncGamma = TRUE; -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR static int default_size = 0; static int default_rate = 0; #endif @@ -113,7 +113,7 @@ static void run_dialog (McsPlugin *); static gboolean save_settings (McsPlugin * plugin); -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR /* */ static void change_size_and_rate (XRRScreenConfiguration * sc, int size, int rate) @@ -207,7 +207,7 @@ } #endif -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM /* */ static void @@ -236,12 +236,12 @@ McsPluginInitResult mcs_plugin_init (McsPlugin * plugin) { -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR XRRScreenConfiguration *sc; #endif McsSetting *setting; gchar *rcfile, *path; -#if defined(USE_XF86VM) || defined(USE_XRANDR) +#if defined(HAVE_XF86VM) || defined(HAVE_XRANDR) int major; int minor; #endif @@ -324,7 +324,7 @@ mcs_manager_set_int (plugin->manager, "XDisplay/syncGamma", CHANNEL, syncGamma); } -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR if (XRRQueryVersion (GDK_DISPLAY (), &major, &minor)) { if ((sc = XRRGetScreenInfo (GDK_DISPLAY (), GDK_ROOT_WINDOW ()))) @@ -358,7 +358,7 @@ } #endif -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM if (XF86VidModeQueryVersion (GDK_DISPLAY (), &major, &minor)) { @@ -392,6 +392,7 @@ return (MCS_PLUGIN_INIT_OK); } + /* */ static gboolean @@ -412,7 +413,8 @@ return (result); } -#ifdef USE_XRANDR + +#ifdef HAVE_XRANDR /* */ static void @@ -490,7 +492,7 @@ } #endif -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM /* */ static void @@ -603,7 +605,7 @@ save_settings (itf->plugin); } -#endif /* !USE_XF86VM */ +#endif /* !HAVE_XF86VM */ /* */ @@ -617,7 +619,7 @@ /* revert settings */ if (haveXrandr) { -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR GtkTreeIter iter; if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (itf->store), &iter)) @@ -641,12 +643,12 @@ } } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (itf->store), &iter)); } -#endif /* !USE_XRANDR */ +#endif /* !HAVE_XRANDR */ } if (haveXxf86vm) { -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM gint rgamma, ggamma, bgamma; rgamma = itf->original_rgamma; @@ -663,7 +665,7 @@ gtk_range_set_value (GTK_RANGE (itf->bscale), bgamma / 100); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (itf->synctoggle), itf->original_sync); -#endif /* !USE_XF86VM */ +#endif /* !HAVE_XF86VM */ } } break; @@ -776,7 +778,7 @@ if (haveXrandr) { -#ifdef USE_XRANDR +#ifdef HAVE_XRANDR XRRScreenConfiguration *sc; Rotation current_rotation; XRRScreenSize *sizes; @@ -848,7 +850,7 @@ /* Store values to revert to */ itf->original_size = current_size; itf->original_rate = current_rate; -#endif /* !USE_XRANDR */ +#endif /* !HAVE_XRANDR */ } else { @@ -910,7 +912,7 @@ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbox), syncGamma); gtk_table_attach (GTK_TABLE (table), checkbox, 0, 3, 2, 3, GTK_FILL, GTK_FILL, 0, BORDER); -#ifdef USE_XF86VM +#ifdef HAVE_XF86VM if (haveXxf86vm) { /* Store values to revert to */ Index: plugins/mouse_plugin/mouse-cursor-settings.c =================================================================== --- plugins/mouse_plugin/mouse-cursor-settings.c (revision 26001) +++ plugins/mouse_plugin/mouse-cursor-settings.c (working copy) @@ -21,7 +21,7 @@ #include #endif -#ifdef HAVE_XCURSOR_EXTENSION +#ifdef HAVE_XCURSOR #ifdef HAVE_STRING_H #include @@ -35,7 +35,7 @@ #include #include - +#include #include #include @@ -47,7 +47,6 @@ #include "mouse-plugin-internal.h" -#define BORDER ( 6 ) #define CURSOR_SIZE_MIN ( 8 ) #define CURSOR_SIZE_MAX ( 64 ) @@ -602,4 +601,4 @@ G_CALLBACK( theme_list_selection_changed_cb ), dialog ); } -#endif /* HAVE_XCURSOR_EXTENSION */ +#endif /* HAVE_XCURSOR */ Index: plugins/mouse_plugin/mouse-plugin-internal.h =================================================================== --- plugins/mouse_plugin/mouse-plugin-internal.h (revision 26001) +++ plugins/mouse_plugin/mouse-plugin-internal.h (working copy) @@ -25,6 +25,8 @@ #include #include +#define BORDER ( 6 ) + #define RCDIR "mcs_settings" #define OLDRCDIR "settings" #define CHANNEL1 "settings" @@ -85,7 +87,7 @@ GtkWidget *cursor_preview_list; GtkWidget *cursor_size_spinbtn; -#ifdef USE_XKB +#ifdef HAVE_XKB /* accessibility tab */ GtkWidget *accessx_page; GtkWidget *checkbutton_mouse; Index: plugins/mouse_plugin/mouse_plugin.c =================================================================== --- plugins/mouse_plugin/mouse_plugin.c (revision 26001) +++ plugins/mouse_plugin/mouse_plugin.c (working copy) @@ -24,11 +24,11 @@ #include -#ifdef USE_XKB +#ifdef HAVE_XKB #include #endif -#ifdef USE_XINPUT +#ifdef HAVE_XINPUT #include #endif @@ -41,7 +41,6 @@ #include #include #include -#include #include "mouse-plugin-internal.h" @@ -62,32 +61,9 @@ #define DEFAULT_ICON_SIZE 48 #define DEFAULT_PTR_MAP_SIZE 128 -#ifdef USE_XKB -static const char * mouse_tray_image_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #FFFFFF", -" ", -" ...... ", -" .+.++.+. ", -" .+.++.+. ", -" .++.++.++. ", -" .++.++.++. ", -" .......... ", -" .++++++++. ", -" .++++++++. ", -" .++++++++. ", -" .++++++++. ", -" .++++++++. ", -" .++++++++. ", -" .++++++. ", -" ...... ", -" "}; -#endif - static void create_channel(McsPlugin * mcs_plugin); static void run_dialog(McsPlugin * mcs_plugin); +static void setup_dialog(Itf * itf); static gboolean is_running = FALSE; static gboolean right_handed = TRUE; @@ -97,18 +73,17 @@ static int threshold = DEFAULT_THRESHOLD; static int denominator = DEFAULT_DENOMINATOR; -#ifdef USE_XKB +#ifdef HAVE_XKB static gboolean mouse_key = FALSE; static int mouse_keys_delay = 200; static int mouse_keys_interval = 200; static int mouse_keys_ttm = 200; static int mouse_keys_max_speed = 200; static gboolean xkbpresent = FALSE; -GtkWidget *mouse_tray_icon = NULL; -GtkWidget *mouse_tray_image = NULL; +GtkStatusIcon *mouse_status_icon = NULL; #endif -#ifdef USE_XINPUT +#ifdef HAVE_XINPUT static gboolean xinputpresent = FALSE; #endif @@ -132,7 +107,7 @@ gdk_error_trap_pop(); } -#ifdef USE_XINPUT +#ifdef HAVE_XINPUT static gboolean check_xinput_support (void) { @@ -250,7 +225,7 @@ gdk_flush(); gdk_error_trap_push(); -#ifdef USE_XINPUT +#ifdef HAVE_XINPUT if (xinputpresent) { set_xinput_mouse_values (right_handed); @@ -369,7 +344,7 @@ mouse_plugin_write_options(mcs_plugin); } -#ifdef USE_XKB +#ifdef HAVE_XKB void create_accessx_page(Itf *dialog) { @@ -379,6 +354,7 @@ GtkWidget *main_vbox = gtk_vbox_new(FALSE, 5); vbox = gtk_vbox_new (FALSE, 5); + gtk_container_set_border_width (GTK_CONTAINER (vbox), BORDER); gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0); @@ -455,7 +431,8 @@ } #endif -Itf *create_mouse_dialog(McsPlugin * mcs_plugin) +static Itf * +create_mouse_dialog (McsPlugin * mcs_plugin) { Itf *dialog; GtkSizeGroup *sg; @@ -660,14 +637,14 @@ gtk_dialog_add_action_widget(GTK_DIALOG(dialog->mouse_dialog), dialog->closebutton1, GTK_RESPONSE_CLOSE); GTK_WIDGET_SET_FLAGS(dialog->closebutton1, GTK_CAN_DEFAULT); -#ifdef HAVE_XCURSOR_EXTENSION +#ifdef HAVE_XCURSOR label = gtk_label_new(_("Cursor")); gtk_widget_show(label); mouse_plugin_create_cursor_page(dialog); gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook), dialog->cursor_page, label); #endif -#ifdef USE_XKB +#ifdef HAVE_XKB label = gtk_label_new(_("Accessibility")); gtk_widget_show(label); create_accessx_page(dialog); @@ -678,31 +655,45 @@ return dialog; } -#ifdef USE_XKB static void -cb_mouse_tray_icon_embedded(GtkWidget *tray_icon, gpointer user_data) +run_mouse_dialog (McsPlugin * mcs_plugin, gboolean focus_accessibility_tab) { - gtk_container_add(GTK_CONTAINER(tray_icon), mouse_tray_image); - gtk_widget_show_all(tray_icon); -} + static Itf *dialog = NULL; -static void -mouse_tray_icon_reconnect() -{ - mouse_tray_icon = netk_tray_icon_new(DefaultScreenOfDisplay(GDK_DISPLAY())); - g_signal_connect(G_OBJECT(mouse_tray_icon), "embedded", G_CALLBACK(cb_mouse_tray_icon_embedded), NULL); + xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); + + if (is_running) + { + if((dialog) && (dialog->mouse_dialog)) + { + gtk_window_present(GTK_WINDOW(dialog->mouse_dialog)); + +#ifdef HAVE_XKB + if (focus_accessibility_tab) + gtk_notebook_set_current_page (GTK_NOTEBOOK (dialog->notebook), 2); +#endif + } + return; + } + + is_running = TRUE; + + dialog = create_mouse_dialog (mcs_plugin); + setup_dialog (dialog); + + if (focus_accessibility_tab) + gtk_notebook_set_current_page (GTK_NOTEBOOK (dialog->notebook), 2); } +#ifdef HAVE_XKB static void -cb_mouse_tray_icon_destroy(GtkWidget *tray_icon, GtkWidget *image) +status_icon_activated (GtkStatusIcon *status_icon, McsPlugin * mcs_plugin) { - gtk_widget_ref(image); - gtk_container_remove(GTK_CONTAINER(tray_icon), image); - mouse_tray_icon_reconnect(); + run_mouse_dialog (mcs_plugin, TRUE); } static void -toggle_accessx() +toggle_accessx (McsPlugin *mcs_plugin) { if (xkbpresent) { @@ -720,22 +711,24 @@ xkb->ctrls->mk_time_to_max = mouse_keys_ttm; xkb->ctrls->mk_max_speed = mouse_keys_max_speed; - if(!mouse_tray_icon) + if(!mouse_status_icon) { - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data(mouse_tray_image_xpm); - mouse_tray_image = gtk_image_new_from_pixbuf(pixbuf); - mouse_tray_icon = netk_tray_icon_new(DefaultScreenOfDisplay(GDK_DISPLAY())); - gtk_container_add(GTK_CONTAINER(mouse_tray_icon), mouse_tray_image); - g_signal_connect(G_OBJECT(mouse_tray_icon), "destroy", G_CALLBACK(cb_mouse_tray_icon_destroy), mouse_tray_image); + /* create tray icon */ + mouse_status_icon = gtk_status_icon_new_from_icon_name ("input-mouse"); + g_signal_connect (G_OBJECT (mouse_status_icon), "activate", G_CALLBACK (status_icon_activated), mcs_plugin); + gtk_status_icon_set_tooltip (mouse_status_icon, _("Mouse emulation enabled")); } - if(mouse_tray_icon) - gtk_widget_show_all(mouse_tray_icon); + + /* show */ + if (mouse_status_icon) + gtk_status_icon_set_visible (mouse_status_icon, TRUE); } else { xkb->ctrls->enabled_ctrls &= ~XkbMouseKeysMask; - if(mouse_tray_icon) - gtk_widget_hide(mouse_tray_icon); + + if(mouse_status_icon) + gtk_status_icon_set_visible (mouse_status_icon, FALSE); } XkbSetControls (GDK_DISPLAY (), XkbControlsEnabledMask | XkbMouseKeysMask | XkbMouseKeysAccelMask, xkb); @@ -754,14 +747,14 @@ cb_scale_accessx_changed (GtkWidget * widget, gpointer user_data) { Itf *itf = (Itf *)user_data; - McsPlugin *mcs_plugin = itf->mcs_plugin; + McsPlugin *mcs_plugin = itf->mcs_plugin; mouse_keys_delay = (int) gtk_range_get_value (GTK_RANGE (itf->scale_mouse_keys_delay)); mouse_keys_interval = (int) gtk_range_get_value (GTK_RANGE (itf->scale_mouse_keys_interval)); mouse_keys_ttm= (int) gtk_range_get_value (GTK_RANGE (itf->scale_mouse_keys_ttm)); mouse_keys_max_speed= (int) gtk_range_get_value (GTK_RANGE (itf->scale_mouse_keys_max_speed)); - toggle_accessx(); + toggle_accessx (mcs_plugin); mcs_manager_set_int (mcs_plugin->manager, "Mouse/MouseKeysDelay", CHANNEL2, mouse_keys_delay); mcs_manager_set_int (mcs_plugin->manager, "Mouse/MouseKeysInterval", CHANNEL2, mouse_keys_interval); mcs_manager_set_int (mcs_plugin->manager, "Mouse/MouseKeysTimeToMax", CHANNEL2, mouse_keys_ttm); @@ -782,7 +775,7 @@ gtk_widget_set_sensitive(itf->scale_mouse_keys_ttm, mouse_key); gtk_widget_set_sensitive(itf->scale_mouse_keys_max_speed, mouse_key); - toggle_accessx(); + toggle_accessx (mcs_plugin); mcs_manager_set_int (mcs_plugin->manager, "Mouse/MouseKeys", CHANNEL2, mouse_key ? 1 : 0); mcs_manager_notify(mcs_plugin->manager, CHANNEL2); mouse_plugin_write_options (mcs_plugin); @@ -800,7 +793,7 @@ g_signal_connect(G_OBJECT(itf->hscale3), "value_changed", (GCallback) cb_dnd_threshold_changed, itf); g_signal_connect(G_OBJECT(itf->hscale4), "value_changed", (GCallback) cb_dbl_clicktime_changed, itf); -#ifdef USE_XKB +#ifdef HAVE_XKB g_signal_connect(G_OBJECT(itf->checkbutton_mouse), "toggled", (GCallback) cb_checkbutton_accessx_changed , itf); g_signal_connect(G_OBJECT(itf->scale_mouse_keys_delay), "value_changed", (GCallback) cb_scale_accessx_changed , itf); g_signal_connect(G_OBJECT(itf->scale_mouse_keys_interval), "value_changed", (GCallback) cb_scale_accessx_changed, itf); @@ -839,7 +832,7 @@ { McsSetting *setting; gchar *rcfile, *path; -#ifdef USE_XKB +#ifdef HAVE_XKB int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; int xkbopcode, xkbevent, xkberror; #endif @@ -910,7 +903,7 @@ mcs_manager_set_int(mcs_plugin->manager, "Net/DndDragThreshold", CHANNEL1, dnd_threshold); } -#ifdef USE_XINPUT +#ifdef HAVE_XINPUT #ifdef DEBUG g_message ("Querying XINPUT extension"); #endif @@ -972,7 +965,7 @@ mcs_manager_set_int(mcs_plugin->manager, "Mouse/Threshold", CHANNEL2, threshold); } -#ifdef USE_XKB +#ifdef HAVE_XKB #ifdef DEBUG g_message ("Querying Xkb extension"); #endif @@ -1045,11 +1038,11 @@ mcs_manager_set_int (mcs_plugin->manager, "Mouse/MouseKeysTimeToMax", CHANNEL2, mouse_keys_ttm); } - toggle_accessx(); + toggle_accessx (mcs_plugin); #endif set_mouse_values(right_handed, acceleration, threshold); -#ifdef HAVE_XCURSOR_EXTENSION +#ifdef HAVE_XCURSOR mouse_plugin_set_initial_cursor_values(mcs_plugin); #endif @@ -1089,22 +1082,7 @@ static void run_dialog(McsPlugin *mcs_plugin) { - static Itf *dialog = NULL; - - xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8"); - - if (is_running) - { - if((dialog) && (dialog->mouse_dialog)) - { - gtk_window_present(GTK_WINDOW(dialog->mouse_dialog)); - } - return; - } - - is_running = TRUE; - dialog = create_mouse_dialog(mcs_plugin); - setup_dialog(dialog); + run_mouse_dialog (mcs_plugin, FALSE); } /* macro defined in manager-plugin.h */ Index: plugins/ui_plugin/ui_plugin.c =================================================================== --- plugins/ui_plugin/ui_plugin.c (revision 26001) +++ plugins/ui_plugin/ui_plugin.c (working copy) @@ -35,7 +35,7 @@ #endif #include - +#include #include #include #include Index: plugins/keyboard_plugin/keyboard_plugin.c =================================================================== --- plugins/keyboard_plugin/keyboard_plugin.c (revision 26001) +++ plugins/keyboard_plugin/keyboard_plugin.c (working copy) @@ -38,11 +38,11 @@ #include -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC #include #endif -#ifdef USE_XKB +#ifdef HAVE_XKB #include #endif @@ -92,11 +92,11 @@ static int repeat_delay = 500; static int repeat_rate = 30; -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC static gboolean miscpresent = FALSE; #endif -#ifdef USE_XKB +#ifdef HAVE_XKB static gboolean xkbpresent = FALSE; #endif @@ -124,14 +124,14 @@ static void set_repeat_rate (int delay, int rate) { -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC XF86MiscKbdSettings values; #endif g_return_if_fail (rate > 0); g_return_if_fail (delay > 0); -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC if (miscpresent) { gdk_flush (); @@ -145,7 +145,7 @@ } #endif -#ifdef USE_XKB +#ifdef HAVE_XKB if (xkbpresent) { XkbDescPtr xkb = XkbAllocKeyboard (); @@ -171,7 +171,7 @@ static void toggle_accessx() { -#ifdef USE_XKB +#ifdef HAVE_XKB if (xkbpresent) { XkbDescPtr xkb = XkbAllocKeyboard (); @@ -911,10 +911,10 @@ { McsSetting *setting; gchar *rcfile, *path; -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC int major, minor; #endif -#ifdef USE_XKB +#ifdef HAVE_XKB int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion; int xkbopcode, xkbevent, xkberror; #endif @@ -1112,7 +1112,7 @@ mcs_manager_set_int (mcs_plugin->manager, "Key/SlowKeysDelay", CHANNEL2, slow_keys_delay); } -#ifdef USE_XF86MISC +#ifdef HAVE_XF86MISC #ifdef DEBUG g_message ("Querying XF86Misc extension"); #endif @@ -1136,7 +1136,7 @@ #endif #endif -#ifdef USE_XKB +#ifdef HAVE_XKB #ifdef DEBUG g_message ("Querying Xkb extension"); #endif Index: plugins/keyboard_plugin/shortcuts_plugin.c =================================================================== --- plugins/keyboard_plugin/shortcuts_plugin.c (revision 26001) +++ plugins/keyboard_plugin/shortcuts_plugin.c (working copy) @@ -37,7 +37,7 @@ #include #include - +#include #include #include #include Index: configure.in.in =================================================================== --- configure.in.in (revision 26001) +++ configure.in.in (working copy) @@ -90,27 +90,13 @@ AC_HELP_STRING([--enable-xf86misc], [try to use the xf86misc extension]) AC_HELP_STRING([--disable-xf86misc], [don't try to use the xf86misc extension]), [], [enable_xf86misc=no]) -XF86MISC_CFLAGS= XF86MISC_LIBS= +XF86MISC_LIBS= if test x"$enable_xf86misc" = x"yes"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $CPPFLAGS $LIBX11_CFLAGS" - LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXext -lXxf86misc" - AC_MSG_CHECKING([whether we can use the xf86misc extension]) - AC_TRY_LINK( - [ -#include -#include - ], [Bool b = XF86MiscQueryVersion((void *)0, (void *)0, (void *)0);], - [ - XF86MISC_CFLAGS="-DUSE_XF86MISC" - XF86MISC_LIBS="-lXext -lXxf86misc" - AC_MSG_RESULT([yes]) - ], [ AC_MSG_RESULT([no]) ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + AC_CHECK_LIB(Xxf86misc, XF86MiscQueryExtension, + [XF86MISC_LIBS="-lXext -lXxf86misc" + AC_DEFINE([HAVE_XF86MISC], [1], [Define if Xxf86misc is present])], + [],[$LIBX11_LIBS -lXext -lXxf86misc]) fi -AC_SUBST([XF86MISC_CFLAGS]) AC_SUBST([XF86MISC_LIBS]) dnl *********************************** @@ -120,57 +106,29 @@ AC_HELP_STRING([--enable-xkb], [try to use the XKB extension]) AC_HELP_STRING([--disable-xkb], [don't try to use the XKB extension]), [], [enable_xkb=yes]) -XKB_CFLAGS= XKB_LIBS= +XKB_LIBS= if test x"$enable_xkb" = x"yes"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $CPPFLAGS $LIBX11_CFLAGS" - LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXext" - AC_MSG_CHECKING([whether we can use the XKB extension]) - AC_TRY_LINK( - [ -#include -#include - ], [ Bool b = XkbLibraryVersion((void *)0, (void *)0); ], - [ - XKB_CFLAGS="-DUSE_XKB" - XKB_LIBS="-lXext" - AC_MSG_RESULT([yes]) - ], [ AC_MSG_RESULT([no]) ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + AC_CHECK_LIB(Xext, XkbLibraryVersion, + [XKB_LIBS="-lXi" + AC_DEFINE([HAVE_XKB], [1], [Define if XInput is present])], + [],[$LIBX11_LIBS -lXi]) fi -AC_SUBST([XKB_CFLAGS]) AC_SUBST([XKB_LIBS]) dnl ********************************** -dnl *** Check for XINPUT extension *** +dnl *** Check for XInput extension *** dnl ********************************** AC_ARG_ENABLE([xinput], AC_HELP_STRING([--enable-xinput], [try to use the XINPUT extension]) AC_HELP_STRING([--disable-xinput], [don't try to use the XINPUT extension]), [], [enable_xinput=yes]) -XINPUT_CFLAGS= XINPUT_LIBS= +XINPUT_LIBS= if test x"$enable_xinput" = x"yes"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $CPPFLAGS $LIBX11_CFLAGS" - LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXi" - AC_MSG_CHECKING([whether we can use the XINPUT extension]) - AC_TRY_LINK( - [ -#include -#include - ], [ XDeviceInfo *device_info = XListInputDevices ((void *)0, (void *)0); ], - [ - XINPUT_CFLAGS="-DUSE_XINPUT" - XINPUT_LIBS="-lXi" - AC_MSG_RESULT([yes]) - ], [ AC_MSG_RESULT([no]) ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + AC_CHECK_LIB(Xi, XListInputDevices, + [XINPUT_LIBS="-lXi" + AC_DEFINE([HAVE_XINPUT], [1], [Define if XInput is present])], + [],[$LIBX11_LIBS -lXi]) fi -AC_SUBST([XINPUT_CFLAGS]) AC_SUBST([XINPUT_LIBS]) dnl ********************************* @@ -180,27 +138,13 @@ AC_HELP_STRING([--enable-randr], [try to use the XRANDR extension]) AC_HELP_STRING([--disable-randr], [don't try to use the XRANDR extension]), [], [enable_randr=yes]) -XRANDR_CFLAGS= XRANDR_LIBS= +XRANDR_LIBS="" if test x"$enable_randr" = x"yes"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $CPPFLAGS $LIBX11_CFLAGS" - LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXext -lXrandr -lXrender" - AC_MSG_CHECKING([whether we can use the XRANDR extension]) - AC_TRY_LINK( - [ -#include -#include - ], [XRRScreenConfiguration *sc = XRRGetScreenInfo((void *)0, (void *)0); ], - [ - XRANDR_CFLAGS="-DUSE_XRANDR" - XRANDR_LIBS="-lXext -lXrandr -lXrender" - AC_MSG_RESULT([yes]) - ], [ AC_MSG_RESULT([no]) ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration, + [XRANDR_LIBS="-lXrandr -lXrender" + AC_DEFINE([HAVE_XRANDR], [1], [Define if Xrandr is present])], + [],[$LIBX11_LIBS -lX11 -lXrandr -lXrender]) fi -AC_SUBST([XRANDR_CFLAGS]) AC_SUBST([XRANDR_LIBS]) dnl *********************************** @@ -210,50 +154,29 @@ AC_HELP_STRING([--enable-xf86vm], [try to use the Xxf86vm extension]) AC_HELP_STRING([--disable-xf86vm], [don't try to use the Xxf86vm extension]), [], [enable_xf86vm=yes]) -XF86VM_CFLAGS= XF86VM_LIBS= +XF86VM_LIBS="" if test x"$enable_xf86vm" = x"yes"; then - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $CPPFLAGS $LIBX11_CFLAGS" - LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXext -lXxf86vm" - AC_MSG_CHECKING([whether we can use the Xxf86vm extension]) - AC_TRY_LINK( - [ -#include -#include - ], [XF86VidModeSetGamma((void *)0, 0, (void *)0);], - [ - XF86VM_CFLAGS="-DUSE_XF86VM" - XF86VM_LIBS="-lXext -lXxf86vm" - AC_MSG_RESULT([yes]) - ], [ AC_MSG_RESULT([no]) ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" + AC_CHECK_LIB(Xxf86vm, XF86VidModeSetGamma, + [XF86VM_LIBS="-lXext -lXxf86vm" + AC_DEFINE([HAVE_XF86VM], [1], [Define if Xxf86vm is present])], + [],[$LIBX11_LIBS -lX11 -lXext -lXxf86vm]) fi -AC_SUBST([XF86VM_CFLAGS]) AC_SUBST([XF86VM_LIBS]) dnl **************************************** dnl *** Check for Xcursor (mouse plugin) *** dnl **************************************** -ac_save_CFLAGS="$CFLAGS" -ac_save_LIBS="$LIBS" -CFLAGS="$CFLAGS $LIBX11_CFLAGS" -LIBS="$LIBS $LIBX11_LDFLAGS $LIBX11_LIBS -lXcursor" -XCURSOR_LIBS= -AC_CHECK_LIB([Xcursor], [XcursorGetDefaultSize], -[ - XCURSOR_LIBS="-lXcursor" - AC_DEFINE([HAVE_XCURSOR_EXTENSION], [1], [Define if XCURSOR is present]) -]) -CFLAGS="$ac_save_CFLAGS" -LIBS="$ac_save_LIBS" +XCURSOR_LIBS="" +AC_CHECK_LIB(Xcursor, XcursorGetDefaultSize, + [XCURSOR_LIBS="-lXcursor" + AC_DEFINE([HAVE_XCURSOR], [1], [Define if Xcursor is present])], + [],[$LIBX11_LIBS -lXcursor]) AC_SUBST([XCURSOR_LIBS]) dnl *********************************** dnl *** Check for required packages *** dnl *********************************** -XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.6.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0]) XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0]) dnl **********************************