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:
parent
9f3911865f
commit
d80e0c86be
4 changed files with 37 additions and 6 deletions
|
@ -1,5 +1,13 @@
|
||||||
2002-03-29 Jody Goldberg <jody@gnome.org>
|
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.
|
||||||
|
|
||||||
* gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
|
* gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
|
||||||
fix spelling error in schema.
|
fix spelling error in schema.
|
||||||
|
|
||||||
|
|
|
@ -169,10 +169,12 @@ set_server_from_gconf (GConfEntry *ignored)
|
||||||
XkbMouseKeysMask | XkbMouseKeysAccelMask |
|
XkbMouseKeysMask | XkbMouseKeysAccelMask |
|
||||||
XkbSlowKeysMask | XkbBounceKeysMask;
|
XkbSlowKeysMask | XkbBounceKeysMask;
|
||||||
|
|
||||||
|
gdk_error_trap_push ();
|
||||||
we_are_changing_xkb_state = TRUE;
|
we_are_changing_xkb_state = TRUE;
|
||||||
XkbSetControls (GDK_DISPLAY (), which, desc);
|
XkbSetControls (GDK_DISPLAY (), which, desc);
|
||||||
XFlush (GDK_DISPLAY ());
|
XFlush (GDK_DISPLAY ());
|
||||||
we_are_changing_xkb_state = FALSE;
|
we_are_changing_xkb_state = FALSE;
|
||||||
|
gdk_error_trap_pop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -46,9 +46,6 @@ apply_settings (void)
|
||||||
int rate, delay;
|
int rate, delay;
|
||||||
int click_volume, bell_volume, bell_pitch, bell_duration;
|
int click_volume, bell_volume, bell_pitch, bell_duration;
|
||||||
|
|
||||||
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
|
|
||||||
XF86MiscKbdSettings kbdsettings;
|
|
||||||
#endif
|
|
||||||
XKeyboardControl kbdcontrol;
|
XKeyboardControl kbdcontrol;
|
||||||
int event_base_return, error_base_return;
|
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_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);
|
bell_duration = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_duration", NULL);
|
||||||
|
|
||||||
|
gdk_error_trap_push ();
|
||||||
if (repeat) {
|
if (repeat) {
|
||||||
XAutoRepeatOn (GDK_DISPLAY ());
|
XAutoRepeatOn (GDK_DISPLAY ());
|
||||||
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
|
#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
|
||||||
|
@ -70,10 +68,13 @@ apply_settings (void)
|
||||||
&event_base_return,
|
&event_base_return,
|
||||||
&error_base_return) == True)
|
&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.rate = rate;
|
||||||
kbdsettings.delay = delay;
|
kbdsettings.delay = delay;
|
||||||
kbdsettings.servnumlock = False;
|
|
||||||
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
|
XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
|
||||||
} else {
|
} else {
|
||||||
XAutoRepeatOff (GDK_DISPLAY ());
|
XAutoRepeatOff (GDK_DISPLAY ());
|
||||||
|
@ -94,6 +95,9 @@ apply_settings (void)
|
||||||
kbdcontrol.bell_duration = bell_duration;
|
kbdcontrol.bell_duration = bell_duration;
|
||||||
XChangeKeyboardControl (GDK_DISPLAY (), KBKeyClickPercent,
|
XChangeKeyboardControl (GDK_DISPLAY (), KBKeyClickPercent,
|
||||||
&kbdcontrol);
|
&kbdcontrol);
|
||||||
|
|
||||||
|
XFlush (GDK_DISPLAY ());
|
||||||
|
gdk_error_trap_pop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,19 @@ struct _TranslationEntry
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
translate_bool_int (TranslationEntry *trans,
|
||||||
|
GConfValue *value)
|
||||||
|
{
|
||||||
|
g_assert (value->type == trans->gconf_type);
|
||||||
|
|
||||||
|
g_print ("setting %s %d\n",
|
||||||
|
trans->xsetting_name,
|
||||||
|
gconf_value_get_bool (value));
|
||||||
|
xsettings_manager_set_int (manager, trans->xsetting_name,
|
||||||
|
gconf_value_get_bool (value));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
translate_int_int (TranslationEntry *trans,
|
translate_int_int (TranslationEntry *trans,
|
||||||
GConfValue *value)
|
GConfValue *value)
|
||||||
|
@ -62,7 +75,11 @@ static TranslationEntry translations [] = {
|
||||||
{ "/desktop/gnome/interface/gtk_key_theme", "Gtk/KeyThemeName", GCONF_VALUE_STRING,
|
{ "/desktop/gnome/interface/gtk_key_theme", "Gtk/KeyThemeName", GCONF_VALUE_STRING,
|
||||||
translate_string_string },
|
translate_string_string },
|
||||||
{ "/desktop/gnome/interface/font_name", "Gtk/FontName", GCONF_VALUE_STRING,
|
{ "/desktop/gnome/interface/font_name", "Gtk/FontName", GCONF_VALUE_STRING,
|
||||||
translate_string_string }
|
translate_string_string },
|
||||||
|
{ "/desktop/gnome/interface/cursor_blink", "Net/CursorBlink",
|
||||||
|
GCONF_VALUE_BOOL, translate_bool_int },
|
||||||
|
{ "/desktop/gnome/interface/cursor_blink_time", "Net/CursorBlinkTime",
|
||||||
|
GCONF_VALUE_INT, translate_int_int }
|
||||||
};
|
};
|
||||||
|
|
||||||
static TranslationEntry*
|
static TranslationEntry*
|
||||||
|
|
Loading…
Add table
Reference in a new issue