gcompat: get closer to working with gtk3
Just need the draw event now, instead of the expose_event.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/gfio.c b/gfio.c
index 1ee2745..24783b2 100644
--- a/gfio.c
+++ b/gfio.c
@@ -315,11 +315,13 @@
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;
- 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;
}
@@ -355,7 +357,7 @@
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)) {