diff options
author | Jonathan Blandford <jrb@src.gnome.org> | 2001-12-16 08:24:23 +0000 |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2001-12-16 08:24:23 +0000 |
commit | f666939831cb0bf257e00f0465582a89a3dad4ab (patch) | |
tree | 42a483f5a4e5965ea56733ec141fd0bb4b8bc967 /gnome-settings-daemon | |
parent | 48afecfd9c5a543e88b5590c6a5547e59bf8e307 (diff) | |
download | gnome-control-center-f666939831cb0bf257e00f0465582a89a3dad4ab.tar.gz |
Handle mouse properties.
Diffstat (limited to 'gnome-settings-daemon')
-rw-r--r-- | gnome-settings-daemon/.cvsignore | 3 | ||||
-rw-r--r-- | gnome-settings-daemon/gnome-settings-daemon.c | 9 | ||||
-rw-r--r-- | gnome-settings-daemon/gnome-settings-daemon.h | 7 | ||||
-rw-r--r-- | gnome-settings-daemon/gnome-settings-mouse.c | 55 | ||||
-rw-r--r-- | gnome-settings-daemon/gnome-settings-xsettings.c | 11 |
5 files changed, 79 insertions, 6 deletions
diff --git a/gnome-settings-daemon/.cvsignore b/gnome-settings-daemon/.cvsignore new file mode 100644 index 000000000..8b83411ca --- /dev/null +++ b/gnome-settings-daemon/.cvsignore @@ -0,0 +1,3 @@ +Makefile +Makefile.in +gnome-settings-daemon diff --git a/gnome-settings-daemon/gnome-settings-daemon.c b/gnome-settings-daemon/gnome-settings-daemon.c index 85ff88bcc..daaad4c35 100644 --- a/gnome-settings-daemon/gnome-settings-daemon.c +++ b/gnome-settings-daemon/gnome-settings-daemon.c @@ -69,6 +69,15 @@ gnome_settings_daemon_register_callback (const char *dir, } } +GtkWidget * +gnome_settings_daemon_get_invisible (void) +{ + static GtkWidget *invisible = NULL; + if (invisible == NULL) + invisible = gtk_invisible_new (); + return invisible; +} + static void config_notify (GConfEngine *client, guint cnxn_id, diff --git a/gnome-settings-daemon/gnome-settings-daemon.h b/gnome-settings-daemon/gnome-settings-daemon.h index fcf22e92b..1851ae41b 100644 --- a/gnome-settings-daemon/gnome-settings-daemon.h +++ b/gnome-settings-daemon/gnome-settings-daemon.h @@ -25,10 +25,13 @@ #define GNOME_SETTINGS_XSETTINGS_H #include <gconf/gconf.h> +#include <gtk/gtk.h> + typedef void (* KeyCallbackFunc) (GConfEntry *entry); -void gnome_settings_daemon_register_callback (const char *dir, - KeyCallbackFunc func); +void gnome_settings_daemon_register_callback (const char *dir, + KeyCallbackFunc func); +GtkWidget *gnome_settings_daemon_get_invisible (void); #endif /* GNOME_SETTINGS_XSETTINGS_H */ diff --git a/gnome-settings-daemon/gnome-settings-mouse.c b/gnome-settings-daemon/gnome-settings-mouse.c index 0ef65d037..67c503a24 100644 --- a/gnome-settings-daemon/gnome-settings-mouse.c +++ b/gnome-settings-daemon/gnome-settings-mouse.c @@ -1,10 +1,58 @@ -#include <X11/Xlib.h> +#include <gdk/gdk.h> #include <gdk/gdkx.h> #include <gconf/gconf.h> #include <math.h> #define MAX_BUTTONS 10 +#if 0 +GdkWindow *window = NULL; + +static gint +locate_pointer_expose (GtkWidget *widget, + GdkExposeEvent *event, + gpointer data) +{ +} + + +static void +create_window (void) +{ + GdkWindowAttr attributes; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; + attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view)); + attributes.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view)); + attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK; + window = gdk_window_new (gdk_get_default_root_window (), + &attributes, + GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP); + gdk_window_set_user_data (tree_view->priv->drag_highlight_window, gnome_settings_daemon_get_invisible ()); + g_signal_connect (G_OBJECT (gnome_settings_daemon_get_invisible ()), + "expose_event", + locate_pointer_expose, + NULL); +} + +static void +locate_pointer (void) +{ + GtkWidget *window; + gint cursor_x, cursor_y; + + window = gtk_window_new (GTK_WINDOW_POPUP); + gdk_window_get_pointer (NULL, &cursor_x, &cursor_y, NULL); + + if (window == NULL) + create_window (); + +} +#endif + + + + static void set_left_handed (gboolean left_handed) { @@ -12,6 +60,7 @@ set_left_handed (gboolean left_handed) gint n_buttons, i; gint idx_1 = 0, idx_3 = 1; + g_print ("daemon: set_left_handed %d\n", left_handed); n_buttons = XGetPointerMapping (GDK_DISPLAY (), buttons, MAX_BUTTONS); for (i = 0; i < n_buttons; i++) @@ -95,10 +144,13 @@ set_drag_threshold (gint drag_threshold) static void mouse_callback (GConfEntry *entry) { + g_print ("daemon: gconf callback %s\n", entry->key); if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/left_handed")) { if (entry->value->type == GCONF_VALUE_BOOL) set_left_handed (gconf_value_get_bool (entry->value)); + else + g_warning ("wrong type!\n"); } else if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/motion_acceleration")) { @@ -122,5 +174,4 @@ gnome_settings_mouse_init (GConfEngine *engine) void gnome_settings_mouse_load (GConfEngine *engine) { - } diff --git a/gnome-settings-daemon/gnome-settings-xsettings.c b/gnome-settings-daemon/gnome-settings-xsettings.c index 47ee48a9d..24cb09240 100644 --- a/gnome-settings-daemon/gnome-settings-xsettings.c +++ b/gnome-settings-daemon/gnome-settings-xsettings.c @@ -26,6 +26,9 @@ translate_int_int (TranslationEntry *trans, { g_assert (value->type == trans->gconf_type); + g_print ("setting %s %d\n", + trans->xsetting_name, + gconf_value_get_int (value)); xsettings_manager_set_int (manager, trans->xsetting_name, gconf_value_get_int (value)); } @@ -36,13 +39,16 @@ translate_string_string (TranslationEntry *trans, { g_assert (value->type == trans->gconf_type); + g_print ("setting %s %s\n", + trans->xsetting_name, + gconf_value_get_string (value)); xsettings_manager_set_string (manager, trans->xsetting_name, gconf_value_get_string (value)); } static TranslationEntry translations [] = { - { "/desktop/gnome/double-click-time", "Net/DoubleClickTime", GCONF_VALUE_INT, + { "/desktop/gnome/peripherals/mouse/double_click", "Net/DoubleClickTime", GCONF_VALUE_INT, translate_int_int }, { "/desktop/gnome/gtk-color-palette", "Gtk/ColorPalette", GCONF_VALUE_STRING, translate_string_string }, @@ -135,6 +141,7 @@ xsettings_callback (GConfEntry *entry) TranslationEntry *trans; trans = find_translation_entry (entry->key); + g_print ("daemon: notified on %s\n", entry->key); if (trans == NULL) return; @@ -146,7 +153,7 @@ xsettings_callback (GConfEntry *entry) void gnome_settings_xsettings_init (GConfEngine *engine) { - gnome_settings_daemon_register_callback ("/desktop/standard", xsettings_callback); + gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/mouse", xsettings_callback); gnome_settings_daemon_register_callback ("/desktop/gtk", xsettings_callback); } |