From: Jean-Philippe Orsini Date: Sat, 7 May 2011 07:28:18 +0000 (+0000) Subject: avoid use of GtkWidget.allocation (does not exist in gtk3) X-Git-Tag: v0.8.0.5~780 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=926986f0fcce1aa2c1dd4becbb005f6ce0af9c94 avoid use of GtkWidget.allocation (does not exist in gtk3) --- diff --git a/po/Makefile.in b/po/Makefile.in index 0939971..8ca8340 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -21,7 +21,7 @@ srcdir = . top_srcdir = .. -prefix = /usr/local +prefix = /home/jporsini/tmp exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/src/graph.c b/src/graph.c index 2625ce5..f4349d3 100644 --- a/src/graph.c +++ b/src/graph.c @@ -201,29 +201,28 @@ graph_update(struct psensor **sensors, double maxt = get_max_temp(sensors); char *strmax = psensor_value_to_string(SENSOR_TYPE_TEMP, maxt); - int width = w_graph->allocation.width; - int height = w_graph->allocation.height; - - int g_width, g_height; + int width, height, g_width, g_height; /* horizontal and vertical offset of the graph */ int g_xoff, g_yoff; - cairo_surface_t *cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, - width, - height); - cairo_t *cr = cairo_create(cst); - cairo_t *cr_pixmap; + cairo_surface_t *cst; + cairo_t *cr, *cr_pixmap; char *str_btime = time_to_str(get_graph_begin_time_s(config)); - cairo_text_extents_t te_btime; - char *str_etime = time_to_str(get_graph_end_time_s()); - cairo_text_extents_t te_etime; - cairo_text_extents_t te_max, te_min; + cairo_text_extents_t te_btime, te_etime, te_max, te_min; struct psensor **sensor_cur; + GtkAllocation galloc; + + gtk_widget_get_allocation(w_graph, &galloc); + width = galloc.width; + height = galloc.height; + + cst = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); + cr = cairo_create(cst); draw_graph_background(cr, width, height, config);