diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c index 43dfca6..303598e 100644 --- a/libxfce4kbd-private/xfce-shortcuts-grabber.c +++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c @@ -163,9 +163,20 @@ static void xfce_shortcuts_grabber_keys_changed (GdkKeymap *keymap, XfceShortcutsGrabber *grabber) { + static time_t last_execution = 0; + time_t current_call; + g_return_if_fail (XFCE_IS_SHORTCUTS_GRABBER (grabber)); - TRACE ("Keys changed, regrabbing"); + current_call = time (0); + if (current_call - last_execution < 5) + { + DBG ("Cancelled regrabbing"); + return; + } + last_execution = current_call; + + DBG ("Keys changed, regrabbing"); xfce_shortcuts_grabber_ungrab_all (grabber); xfce_shortcuts_grabber_grab_all (grabber);