[libdazzle] shortcuts: add more tracing



commit 01b778dcba5d557fe5933fb3fbf47b78dd5f05f2
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jun 17 14:47:13 2017 -0700

    shortcuts: add more tracing
    
    Having tracing information in these functions can be invaluable
    to tracking down execution issues. So just make these accessible
    to others in the future.

 src/shortcuts/dzl-shortcut-closure-chain.c |    6 ++++++
 src/shortcuts/dzl-shortcut-controller.c    |   17 ++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/src/shortcuts/dzl-shortcut-closure-chain.c b/src/shortcuts/dzl-shortcut-closure-chain.c
index 5e94997..85247c1 100644
--- a/src/shortcuts/dzl-shortcut-closure-chain.c
+++ b/src/shortcuts/dzl-shortcut-closure-chain.c
@@ -21,6 +21,8 @@
 #include <gobject/gvaluecollector.h>
 #include <string.h>
 
+#include "dzl-debug.h"
+
 #include "shortcuts/dzl-shortcut-closure-chain.h"
 #include "shortcuts/dzl-shortcut-controller.h"
 #include "shortcuts/dzl-shortcut-private.h"
@@ -478,19 +480,23 @@ dzl_shortcut_closure_chain_execute (DzlShortcutClosureChain *chain,
   switch (chain->type)
     {
     case DZL_SHORTCUT_CLOSURE_ACTION:
+      DZL_TRACE_MSG ("executing closure action");
       ret |= _dzl_gtk_widget_activate_action (widget, chain->action.group, chain->action.name, 
chain->action.params);
       break;
 
     case DZL_SHORTCUT_CLOSURE_CALLBACK:
+      DZL_TRACE_MSG ("executing closure callback");
       chain->callback.callback (widget, chain->callback.user_data);
       ret = TRUE;
       break;
 
     case DZL_SHORTCUT_CLOSURE_SIGNAL:
+      DZL_TRACE_MSG ("executing closure signal");
       ret |= signal_activate (chain, widget);
       break;
 
     case DZL_SHORTCUT_CLOSURE_COMMAND:
+      DZL_TRACE_MSG ("executing closure command");
       ret |= command_activate (chain, widget);
       break;
 
diff --git a/src/shortcuts/dzl-shortcut-controller.c b/src/shortcuts/dzl-shortcut-controller.c
index 833b9ce..d4107ef 100644
--- a/src/shortcuts/dzl-shortcut-controller.c
+++ b/src/shortcuts/dzl-shortcut-controller.c
@@ -21,6 +21,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "dzl-debug.h"
+
 #include "shortcuts/dzl-shortcut-closure-chain.h"
 #include "shortcuts/dzl-shortcut-context.h"
 #include "shortcuts/dzl-shortcut-controller.h"
@@ -768,6 +770,8 @@ dzl_shortcut_controller_handle_event (DzlShortcutController *self,
   DzlShortcutControllerPrivate *priv = dzl_shortcut_controller_get_instance_private (self);
   DzlShortcutMatch match;
 
+  DZL_ENTRY;
+
   g_return_val_if_fail (DZL_IS_SHORTCUT_CONTROLLER (self), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
 
@@ -803,7 +807,7 @@ dzl_shortcut_controller_handle_event (DzlShortcutController *self,
     {
       priv->current_chord = dzl_shortcut_chord_new_from_event (event);
       if (priv->current_chord == NULL)
-        return GDK_EVENT_PROPAGATE;
+        DZL_RETURN (GDK_EVENT_PROPAGATE);
     }
   else
     {
@@ -811,7 +815,7 @@ dzl_shortcut_controller_handle_event (DzlShortcutController *self,
         {
           g_clear_pointer (&priv->current_chord, dzl_shortcut_chord_free);
           g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CURRENT_CHORD]);
-          return GDK_EVENT_PROPAGATE;
+          DZL_RETURN (GDK_EVENT_PROPAGATE);
         }
     }
 
@@ -861,7 +865,14 @@ dzl_shortcut_controller_handle_event (DzlShortcutController *self,
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_CURRENT_CHORD]);
     }
 
-  return (match ? GDK_EVENT_STOP : GDK_EVENT_PROPAGATE);
+  DZL_TRACE_MSG ("match = %s",
+                match == DZL_SHORTCUT_MATCH_NONE ? "none" :
+                match == DZL_SHORTCUT_MATCH_PARTIAL ? "partial" : "equal");
+
+  if (match != DZL_SHORTCUT_MATCH_NONE)
+    DZL_RETURN (GDK_EVENT_STOP);
+
+  DZL_RETURN (GDK_EVENT_PROPAGATE);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]