Just need the draw event now, instead of the expose_event.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0`
GTK_LDFLAGS = `pkg-config --libs gtk+-2.0 gthread-2.0`
GTK_CFLAGS = `pkg-config --cflags gtk+-2.0 gthread-2.0`
GTK_LDFLAGS = `pkg-config --libs gtk+-2.0 gthread-2.0`
-GTK_CFLAGS += -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
-
SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
struct graph *g = p;
cairo_t *cr;
struct graph *g = p;
cairo_t *cr;
- cr = gdk_cairo_create(w->window);
+ cr = gdk_cairo_create(gtk_widget_get_window(w));
#if 0
if (graph_has_tooltips(g)) {
g_object_set(w, "has-tooltip", TRUE, NULL);
#if 0
if (graph_has_tooltips(g)) {
g_object_set(w, "has-tooltip", TRUE, NULL);
static gint on_config_lat_drawing_area(GtkWidget *w, GdkEventConfigure *event,
gpointer data)
{
static gint on_config_lat_drawing_area(GtkWidget *w, GdkEventConfigure *event,
gpointer data)
{
+ guint width = gtk_widget_get_allocated_width(w);
+ guint height = gtk_widget_get_allocated_height(w);
- graph_set_size(g, w->allocation.width, w->allocation.height);
- graph_set_size(g, w->allocation.width, w->allocation.height);
+ graph_set_size(g, width, height);
+ graph_set_size(g, width, height);
graph_set_position(g, 0, 0);
return TRUE;
}
graph_set_position(g, 0, 0);
return TRUE;
}
+
+#if GTK_MAJOR_VERSION < 3
+
+guint gtk_widget_get_allocated_width(GtkWidget *w)
+{
+ return w->allocation.width;
+}
+
+guint gtk_widget_get_allocated_height(GtkWidget *w)
+{
+ return w->allocation.height;
+}
+
+#endif
+#if GTK_MAJOR_VERSION < 3
+guint gtk_widget_get_allocated_width(GtkWidget *w);
+guint gtk_widget_get_allocated_height(GtkWidget *w);
+#endif
+
static gint on_config_drawing_area(GtkWidget *w, GdkEventConfigure *event,
gpointer data)
{
static gint on_config_drawing_area(GtkWidget *w, GdkEventConfigure *event,
gpointer data)
{
+ guint width = gtk_widget_get_allocated_width(w);
+ guint height = gtk_widget_get_allocated_height(w);
struct gfio_graphs *g = data;
struct gfio_graphs *g = data;
- graph_set_size(g->iops_graph, w->allocation.width / 2.0, w->allocation.height);
- graph_set_position(g->iops_graph, w->allocation.width / 2.0, 0.0);
- graph_set_size(g->bandwidth_graph, w->allocation.width / 2.0, w->allocation.height);
+ graph_set_size(g->iops_graph, width / 2.0, height);
+ graph_set_position(g->iops_graph, width / 2.0, 0.0);
+ graph_set_size(g->bandwidth_graph, width / 2.0, height);
graph_set_position(g->bandwidth_graph, 0, 0);
return TRUE;
}
graph_set_position(g->bandwidth_graph, 0, 0);
return TRUE;
}
struct gfio_graphs *g = p;
cairo_t *cr;
struct gfio_graphs *g = p;
cairo_t *cr;
- cr = gdk_cairo_create(w->window);
+ cr = gdk_cairo_create(gtk_widget_get_window(w));
if (graph_has_tooltips(g->iops_graph) ||
graph_has_tooltips(g->bandwidth_graph)) {
if (graph_has_tooltips(g->iops_graph) ||
graph_has_tooltips(g->bandwidth_graph)) {