[Xfce4-commits] <libxfce4ui:jeromeg/keyboard-shortcuts-rework> Add more debbuging information.

Jérôme Guelfucci noreply at xfce.org
Thu Jun 2 23:32:02 CEST 2011


Updating branch refs/heads/jeromeg/keyboard-shortcuts-rework
         to 56f8e3858e6d84850f51c1772f8f4617bae4dd9b (commit)
       from 5e50a7d5f6f868c12b1d439ff54600b984b2d5bd (commit)

commit 56f8e3858e6d84850f51c1772f8f4617bae4dd9b
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Thu Jun 2 14:54:07 2011 +0200

    Add more debbuging information.

 libxfce4kbd-private/xfce-shortcuts-grabber.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/libxfce4kbd-private/xfce-shortcuts-grabber.c b/libxfce4kbd-private/xfce-shortcuts-grabber.c
index f3d4a50..cd1dbe9 100644
--- a/libxfce4kbd-private/xfce-shortcuts-grabber.c
+++ b/libxfce4kbd-private/xfce-shortcuts-grabber.c
@@ -165,6 +165,8 @@ xfce_shortcuts_grabber_keys_changed (GdkKeymap            *keymap,
 {
   g_return_if_fail (XFCE_IS_SHORTCUTS_GRABBER (grabber));
 
+  TRACE ("Keys changed, regrabbing");
+
   xfce_shortcuts_grabber_ungrab_all (grabber);
   xfce_shortcuts_grabber_grab_all (grabber);
 }
@@ -284,6 +286,7 @@ xfce_shortcuts_grabber_grab (XfceShortcutsGrabber *grabber,
   XkbDescPtr    xmap;
   GdkDisplay   *display;
   GdkKeymap    *keymap;
+  gchar        *shortcut_name;
   guint         modifiers;
   guint         k;
   gint          i, j;
@@ -301,6 +304,16 @@ xfce_shortcuts_grabber_grab (XfceShortcutsGrabber *grabber,
   modifiers = key->modifiers;
   gdk_keymap_map_virtual_modifiers (keymap, &modifiers);
 
+  /* Debugging information */
+  shortcut_name = gtk_accelerator_name (key->keyval, modifiers);
+  if (grab)
+    TRACE ("Grabbing %s", shortcut_name);
+  else
+    TRACE ("Ungrabbing %s", shortcut_name);
+  TRACE ("Keyval: %d", key->keyval);
+  TRACE ("Modifiers: 0x%x", key->modifiers);
+  g_free (shortcut_name);
+
   if (modifiers == key->modifiers &&
       (GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK) & modifiers)
     {
@@ -336,13 +349,18 @@ xfce_shortcuts_grabber_grab (XfceShortcutsGrabber *grabber,
 
       GdkModifierType add_modifiers;
 
+      TRACE ("Keycode: %d", keys[i].keycode);
+
       add_modifiers = FinallyGetModifiersForKeycode (xmap,
                                                      keys[i].keycode,
                                                      keys[i].group,
                                                      keys[i].level);
 
       if (add_modifiers == MODIFIERS_ERROR)
-        continue;
+        {
+          TRACE ("Error when getting modifiers for keycode");
+          continue;
+        }
 
       for (j = 0; j < screens; j++)
         {



More information about the Xfce4-commits mailing list