Display debug message only in debug mode
authorHugo Villeneuve <hugo@hugovil.com>
Sun, 29 Mar 2020 23:42:38 +0000 (19:42 -0400)
committerHugo Villeneuve <hugo@hugovil.com>
Sun, 29 Mar 2020 23:53:38 +0000 (19:53 -0400)
src/clock.c

index 3045047..ab7e3c3 100644 (file)
@@ -399,8 +399,11 @@ draw_handler(GtkWidget *clock, cairo_t *cr, gpointer d G_GNUC_UNUSED)
                event->area.width, event->area.height);
 #elif defined (HAVE_GTK3)
        gdk_cairo_get_clip_rectangle(cr, &rect);
-       printf("Redrawing (%d,%d+%d+%d)\n", rect.x, rect.y,
-              rect.width, rect.height);
+        if (hvclock_infos.debug)
+        {
+            printf("Redrawing (%d,%d+%d+%d)\n", rect.x, rect.y,
+                   rect.width, rect.height);
+        }
 
        cairo_rectangle(cr, rect.x, rect.y, rect.width, rect.height);
        cairo_clip(cr);