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.
This commit is contained in:
Jody Goldberg 2002-03-30 03:25:26 +00:00 committed by Jody Goldberg
parent 9f3911865f
commit d80e0c86be
4 changed files with 37 additions and 6 deletions

View file

@ -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 ();
}