aboutsummaryrefslogtreecommitdiffstats
path: root/trace-graph.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-08 09:45:57 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-08 09:45:57 -0500
commit1d38003f5b84304485a6c96574154676de8c7ae5 (patch)
tree96ab606fa6eace8a254eb4365fc3fa38bed8bdbf /trace-graph.c
parent03ca5aa7293eed10bd85d910a47d9d71e19d50de (diff)
trace-graph: Clear out event info window when leaving drawing
When the pointer leaves the drawing area, sometimes the event info box would stay hanging around. This looks messy, so remove it when the pointer leaves the drawing area. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-graph.c')
-rw-r--r--trace-graph.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/trace-graph.c b/trace-graph.c
index fe2ecb4..4a65fb5 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -1196,6 +1196,16 @@ button_release_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
1196 return TRUE; 1196 return TRUE;
1197} 1197}
1198 1198
1199static gboolean
1200leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
1201{
1202 struct graph_info *ginfo = data;
1203
1204 update_with_backend(ginfo, ginfo->cpu_data_x, ginfo->cpu_data_y,
1205 ginfo->cpu_data_w, ginfo->cpu_data_h);
1206 return FALSE;
1207}
1208
1199static gint hash_pid(gint val) 1209static gint hash_pid(gint val)
1200{ 1210{
1201 /* idle always gets black */ 1211 /* idle always gets black */
@@ -1957,6 +1967,8 @@ trace_graph_create_with_callbacks(struct tracecmd_input *handle,
1957 (GtkSignalFunc) motion_notify_event, ginfo); 1967 (GtkSignalFunc) motion_notify_event, ginfo);
1958 gtk_signal_connect(GTK_OBJECT(ginfo->draw), "button_release_event", 1968 gtk_signal_connect(GTK_OBJECT(ginfo->draw), "button_release_event",
1959 (GtkSignalFunc) button_release_event, ginfo); 1969 (GtkSignalFunc) button_release_event, ginfo);
1970 gtk_signal_connect(GTK_OBJECT(ginfo->draw), "leave-notify-event",
1971 (GtkSignalFunc) leave_notify_event, ginfo);
1960 gtk_signal_connect(GTK_OBJECT(ginfo->draw), "destroy", 1972 gtk_signal_connect(GTK_OBJECT(ginfo->draw), "destroy",
1961 (GtkSignalFunc) destroy_event, ginfo); 1973 (GtkSignalFunc) destroy_event, ginfo);
1962 1974
@@ -1965,7 +1977,8 @@ trace_graph_create_with_callbacks(struct tracecmd_input *handle,
1965 | GDK_BUTTON_PRESS_MASK 1977 | GDK_BUTTON_PRESS_MASK
1966 | GDK_BUTTON_RELEASE_MASK 1978 | GDK_BUTTON_RELEASE_MASK
1967 | GDK_POINTER_MOTION_MASK 1979 | GDK_POINTER_MOTION_MASK
1968 | GDK_POINTER_MOTION_HINT_MASK); 1980 | GDK_POINTER_MOTION_HINT_MASK
1981 | GDK_LEAVE_NOTIFY_MASK);
1969 1982
1970 1983
1971 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(ginfo->scrollwin), 1984 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(ginfo->scrollwin),