summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon/gnome-settings-keyboard.c
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2002-03-30 03:25:26 +0000
committerJody Goldberg <jody@src.gnome.org>2002-03-30 03:25:26 +0000
commitd80e0c86be40959b5abe0f94c23e6d5a331a00b0 (patch)
treee277f57a62c02be211492446d65286bfc71fbcda /gnome-settings-daemon/gnome-settings-keyboard.c
parent9f3911865f2608ecc99dd6959eb3823a8793337f (diff)
downloadgnome-control-center-d80e0c86be40959b5abe0f94c23e6d5a331a00b0.tar.gz
Patch some settings-daemon X errors when running remotely, and enable cursor
blink support. 2002-03-29 Jody Goldberg <jody@gnome.org> * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) : Add a gdk_error_trap just in case. * gnome-settings-keyboard.c (apply_settings) : don't init things to bogus values unless it is ncessary. Add a gdk_error_trap around the X settings to avoid causing the server to exit if something goes wrong. Be sure to flush before we pop the handler.
Diffstat (limited to 'gnome-settings-daemon/gnome-settings-keyboard.c')
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gnome-settings-daemon/gnome-settings-keyboard.c b/gnome-settings-daemon/gnome-settings-keyboard.c
index 97c42d9fd..7ba7c7408 100644
--- a/gnome-settings-daemon/gnome-settings-keyboard.c
+++ b/gnome-settings-daemon/gnome-settings-keyboard.c
@@ -46,9 +46,6 @@ apply_settings (void)
int rate, delay;
int click_volume, bell_volume, bell_pitch, bell_duration;
-#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
- XF86MiscKbdSettings kbdsettings;
-#endif
XKeyboardControl kbdcontrol;
int event_base_return, error_base_return;
@@ -63,6 +60,7 @@ apply_settings (void)
bell_pitch = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_pitch", NULL);
bell_duration = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_duration", NULL);
+ gdk_error_trap_push ();
if (repeat) {
XAutoRepeatOn (GDK_DISPLAY ());
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
@@ -70,10 +68,13 @@ apply_settings (void)
&event_base_return,
&error_base_return) == True)
{
- kbdsettings.type = 0;
+ /* load the current settings */
+ XF86MiscKbdSettings kbdsettings;
+ XF86MiscGetKbdSettings (GDK_DISPLAY (), &kbdsettings);
+
+ /* assign the new values */
kbdsettings.rate = rate;
kbdsettings.delay = delay;
- kbdsettings.servnumlock = False;
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
} else {
XAutoRepeatOff (GDK_DISPLAY ());
@@ -94,6 +95,9 @@ apply_settings (void)
kbdcontrol.bell_duration = bell_duration;
XChangeKeyboardControl (GDK_DISPLAY (), KBKeyClickPercent,
&kbdcontrol);
+
+ XFlush (GDK_DISPLAY ());
+ gdk_error_trap_pop ();
}