Now g-s-d tracks changes in the system xkb configuration
This commit is contained in:
parent
03b0594911
commit
3a71488be7
1 changed files with 38 additions and 1 deletions
|
@ -110,6 +110,42 @@ apply_settings (void)
|
||||||
GSwitchItXkbConfigTerm (&gswic);
|
GSwitchItXkbConfigTerm (&gswic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnome_settings_keyboard_xkb_analyze_sysconfig (void)
|
||||||
|
{
|
||||||
|
GConfClient *confClient;
|
||||||
|
GSwitchItXkbConfig gswicWas, gswicNow;
|
||||||
|
|
||||||
|
if (!initedOk)
|
||||||
|
return;
|
||||||
|
|
||||||
|
confClient = gconf_client_get_default ();
|
||||||
|
GSwitchItXkbConfigInit (&gswicWas, confClient);
|
||||||
|
GSwitchItXkbConfigInit (&gswicNow, confClient);
|
||||||
|
g_object_unref (confClient);
|
||||||
|
GSwitchItXkbConfigLoadSysBackup (&gswicWas);
|
||||||
|
GSwitchItXkbConfigLoadInitial (&gswicNow);
|
||||||
|
|
||||||
|
// config was changed!!!
|
||||||
|
if (g_slist_length (gswicWas.layouts) &&
|
||||||
|
!GSwitchItXkbConfigEquals (&gswicNow, &gswicWas)) {
|
||||||
|
GtkWidget *msg = gtk_message_dialog_new_with_markup (NULL,
|
||||||
|
0,
|
||||||
|
GTK_MESSAGE_ERROR,
|
||||||
|
GTK_BUTTONS_CLOSE,
|
||||||
|
//!! temporary one
|
||||||
|
_
|
||||||
|
("System-wide XKB configuration has changed. "
|
||||||
|
"You may want to adjust your local configuration as well."));
|
||||||
|
g_signal_connect (msg, "response",
|
||||||
|
G_CALLBACK (gtk_widget_destroy), NULL);
|
||||||
|
gtk_widget_show (msg);
|
||||||
|
}
|
||||||
|
GSwitchItXkbConfigSaveSysBackup (&gswicNow);
|
||||||
|
GSwitchItXkbConfigTerm (&gswicWas);
|
||||||
|
GSwitchItXkbConfigTerm (&gswicNow);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnome_settings_keyboard_xkb_chk_lcl_xmm_response (GtkDialog * dlg,
|
gnome_settings_keyboard_xkb_chk_lcl_xmm_response (GtkDialog * dlg,
|
||||||
gint response)
|
gint response)
|
||||||
|
@ -165,8 +201,9 @@ void
|
||||||
gnome_settings_keyboard_xkb_init (GConfClient * client)
|
gnome_settings_keyboard_xkb_init (GConfClient * client)
|
||||||
{
|
{
|
||||||
if (!XklInit (GDK_DISPLAY ())) {
|
if (!XklInit (GDK_DISPLAY ())) {
|
||||||
XklBackupNamesProp ();
|
|
||||||
initedOk = TRUE;
|
initedOk = TRUE;
|
||||||
|
XklBackupNamesProp ();
|
||||||
|
gnome_settings_keyboard_xkb_analyze_sysconfig ();
|
||||||
gnome_settings_keyboard_xkb_chk_lcl_xmm ();
|
gnome_settings_keyboard_xkb_chk_lcl_xmm ();
|
||||||
gnome_settings_daemon_register_callback
|
gnome_settings_daemon_register_callback
|
||||||
("/desktop/gnome/peripherals/keyboard/xkb",
|
("/desktop/gnome/peripherals/keyboard/xkb",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue