aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-17 23:46:53 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-17 23:46:53 -0500
commitfc4871218e73f925b5bd6c7db33a035a5bdd472b (patch)
treebbe9eaee6f31a4dec7cf04652a2814b4eb688d1a
parent5ae609244a60df623e1c04910c4ffca63714b30c (diff)
trace-graph: Keep the flyover event window inside viewable
The flyover event information window currently only stays inside the drawing area. But if the drawing area is not fully exposed, the flyover window may be hidden outside the visible section. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-graph.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/trace-graph.c b/trace-graph.c
index 3525d0d..13fd7c9 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -214,6 +214,8 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y)
214 GdkPixmap *pix; 214 GdkPixmap *pix;
215 static GdkGC *pix_bg; 215 static GdkGC *pix_bg;
216 guint64 offset = 0; 216 guint64 offset = 0;
217 gint view_width;
218 gint view_start;
217 219
218 if (!pix_bg) { 220 if (!pix_bg) {
219 GdkColor color; 221 GdkColor color;
@@ -298,9 +300,11 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y)
298 if (y > height) 300 if (y > height)
299 y -= height; 301 y -= height;
300 302
303 view_start = gtk_adjustment_get_value(ginfo->vadj);
304 view_width = gtk_adjustment_get_page_size(ginfo->vadj);
301 305
302 if (x + width > ginfo->draw->allocation.width) 306 if (x + width > view_start + view_width)
303 x -= ((x + width) - ginfo->draw->allocation.width); 307 x -= (x + width) - (view_start + view_width);
304 308
305 ginfo->cpu_data_x = x; 309 ginfo->cpu_data_x = x;
306 ginfo->cpu_data_y = y; 310 ginfo->cpu_data_y = y;