diff options
author | Monsta <[email protected]> | 2015-03-11 11:10:01 +0300 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2015-03-15 22:35:58 +0100 |
commit | 15e0e981af132d7fe5f838db4826c6b4b2d17a91 (patch) | |
tree | d9ba40ad2b6cd41cb7d089b7b3d27a3ecb5fe6fe | |
parent | 76f5eeb1e32919aeeb99e2c7b53ae133bda53c17 (diff) | |
download | mate-settings-daemon-1.8.tar.bz2 mate-settings-daemon-1.8.tar.xz |
changed the reaction to numlock state to avoid eating 100% CPU1.8
credits to @nileshgr for the patch
Closes https://github.com/mate-desktop/mate-settings-daemon/pull/98
-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 */ |