diff options
author | Monsta <[email protected]> | 2015-03-11 11:10:01 +0300 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2015-03-15 22:35:08 +0100 |
commit | 3495607009f4c0d7f28fde9314d0bfe4e074a8e4 (patch) | |
tree | fd46c0ab26aea828edc7bd24e3753e6101983546 /plugins | |
parent | ab871a72f12df210f3cfe393e65e71d0b79ac965 (diff) | |
download | mate-settings-daemon-3495607009f4c0d7f28fde9314d0bfe4e074a8e4.tar.bz2 mate-settings-daemon-3495607009f4c0d7f28fde9314d0bfe4e074a8e4.tar.xz |
changed the reaction to numlock state to avoid eating 100% CPU
credits to @nileshgr for the patch
Closes https://github.com/mate-desktop/mate-settings-daemon/pull/98
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/keyboard/msd-keyboard-manager.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/keyboard/msd-keyboard-manager.c b/plugins/keyboard/msd-keyboard-manager.c index a4b97e5..8d261b6 100644 --- a/plugins/keyboard/msd-keyboard-manager.c +++ b/plugins/keyboard/msd-keyboard-manager.c @@ -267,10 +267,6 @@ apply_settings (GSettings *settings, bell_volume = (volume_string && !strcmp (volume_string, "on")) ? 50 : 0; g_free (volume_string); -#ifdef HAVE_X11_EXTENSIONS_XKB_H - rnumlock = g_settings_get_boolean (settings, KEY_NUMLOCK_REMEMBER); -#endif /* HAVE_X11_EXTENSIONS_XKB_H */ - gdk_error_trap_push (); if (repeat) { gboolean rate_set = FALSE; @@ -306,8 +302,12 @@ apply_settings (GSettings *settings, &kbdcontrol); #ifdef HAVE_X11_EXTENSIONS_XKB_H - if (manager->priv->have_xkb && rnumlock) { - numlock_set_xkb_state (numlock_get_settings_state (settings)); + rnumlock = g_settings_get_boolean (settings, KEY_NUMLOCK_REMEMBER); + + if (rnumlock == 0 || key == NULL) { + if (manager->priv->have_xkb && rnumlock) { + numlock_set_xkb_state (numlock_get_settings_state (settings)); + } } #endif /* HAVE_X11_EXTENSIONS_XKB_H */ |