From e4fd229641ec94526f7855d2259f7039369f3f52 Mon Sep 17 00:00:00 2001
From: Cedric Roux <cedric.roux@eurecom.fr>
Date: Thu, 19 May 2016 16:00:10 +0200
Subject: [PATCH] gui/timeline.c click event

---
 common/utils/T/tracer/gui/gui.h      | 1 +
 common/utils/T/tracer/gui/timeline.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h
index 464ac94463..6d36cddfd6 100644
--- a/common/utils/T/tracer/gui/gui.h
+++ b/common/utils/T/tracer/gui/gui.h
@@ -88,6 +88,7 @@ int new_color(gui *gui, char *color);
  *      - resize     { int: width }
  *      - scrollup   { int [3]: x, y, key_modifiers }
  *      - scrolldown { int [3]: x, y, key_modifiers }
+ *      - click      { int: button }
  */
 
 /* same type as in gui_defs.h */
diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c
index afcb681f9d..2f1e6121f4 100644
--- a/common/utils/T/tracer/gui/timeline.c
+++ b/common/utils/T/tracer/gui/timeline.c
@@ -74,6 +74,10 @@ static void button(gui *_g, widget *_this, int x, int y,
     d[2] = key_modifiers;
     gui_notify(g, "scrolldown", _this, d);
   }
+  /* button 1/2/3 */
+  if ((button == 1 || button == 2 || button == 3) && up == 0) {
+    gui_notify(g, "click", _this, &button);
+  }
 }
 
 /*************************************************************************/
-- 
GitLab