[gnumeric] Canvas: debug improvement.



commit 15e582fb0de2f501bba11b95ce7932b00dd20106
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 16 17:47:21 2016 -0500

    Canvas: debug improvement.

 src/gnumeric-simple-canvas.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gnumeric-simple-canvas.c b/src/gnumeric-simple-canvas.c
index fa0e136..10b312b 100644
--- a/src/gnumeric-simple-canvas.c
+++ b/src/gnumeric-simple-canvas.c
@@ -4,9 +4,12 @@
 #include "gnumeric-simple-canvas.h"
 
 #include "sheet-control-gui-priv.h"
+#include "gutils.h"
 #include <goffice/goffice.h>
 #include <gsf/gsf-impl-utils.h>
 
+static gboolean debug_canvas_grab;
+
 static GtkWidgetClass const *parent;
 static gint
 gnm_simple_canvas_key_press (GtkWidget *widget, GdkEventKey *event)
@@ -34,6 +37,7 @@ gnm_simple_canvas_class_init (GtkWidgetClass *klass)
        parent = g_type_class_peek_parent (klass);
        klass->key_press_event   = gnm_simple_canvas_key_press;
        klass->key_release_event = gnm_simple_canvas_key_release;
+       debug_canvas_grab = gnm_debug_flag ("canvas-grab");
 }
 
 GSF_CLASS (GnmSimpleCanvas, gnm_simple_canvas,
@@ -57,6 +61,8 @@ gnm_simple_canvas_ungrab (GocItem *item, guint32 etime)
        g_return_if_fail (gcanvas != NULL);
 
        gcanvas->scg->grab_stack--;
+       if (debug_canvas_grab)
+               g_printerr ("Grab dec to %d\n", gcanvas->scg->grab_stack);
        goc_item_ungrab (item);
 }
 
@@ -72,6 +78,8 @@ gnm_simple_canvas_grab (GocItem *item, unsigned int event_mask,
        g_return_val_if_fail (gcanvas != NULL, TRUE);
 
        gcanvas->scg->grab_stack++;
+       if (debug_canvas_grab)
+               g_printerr ("Grab inc to %d\n", gcanvas->scg->grab_stack);
        goc_item_grab (item);
 
        return res;


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