diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | src/indicator-messages.c | 20 |
3 files changed, 22 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am index d08c383..d6f6168 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = \ data \ po -DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall +DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations dist-hook: @if test -d "$(top_srcdir)/.bzr"; \ diff --git a/configure.ac b/configure.ac index f41aff0..8f533db 100644 --- a/configure.ac +++ b/configure.ac @@ -22,6 +22,15 @@ AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +AC_ARG_ENABLE([deprecations], + [AS_HELP_STRING([--enable-deprecations], + [allow deprecated API usage @<:@default=yes@:>@])], + [], + [enable_deprecations=yes]) +AS_IF([test "x$enable_deprecations" = xno], + [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"] +) + ########################### # Dependencies ########################### diff --git a/src/indicator-messages.c b/src/indicator-messages.c index b29edce..b57244c 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -299,6 +299,7 @@ application_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, static gboolean application_triangle_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) { + GtkAllocation allocation; GtkStyle *style; cairo_t *cr; int x, y, arrow_width, arrow_height; @@ -316,11 +317,12 @@ application_triangle_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer /* set arrow position / dimensions */ arrow_width = 5; /* the pixel-based reference triangle is 5x9 */ arrow_height = 9; - x = widget->allocation.x; - y = widget->allocation.y + widget->allocation.height/2.0 - (double)arrow_height/2.0; + gtk_widget_get_allocation (widget, &allocation); + x = allocation.x; + y = allocation.y + allocation.height/2.0 - (double)arrow_height/2.0; /* initialize cairo drawing area */ - cr = (cairo_t*) gdk_cairo_create (widget->window); + cr = (cairo_t*) gdk_cairo_create (gtk_widget_get_window (widget)); /* set line width */ cairo_set_line_width (cr, 1.0); @@ -359,6 +361,7 @@ custom_cairo_rounded_rectangle (cairo_t *cr, static gboolean numbers_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) { + GtkAllocation allocation; GtkStyle *style; cairo_t *cr; double x, y, w, h; @@ -371,10 +374,11 @@ numbers_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) style = gtk_widget_get_style (widget); /* set arrow position / dimensions */ - w = widget->allocation.width; - h = widget->allocation.height; - x = widget->allocation.x; - y = widget->allocation.y; + gtk_widget_get_allocation (widget, &allocation); + w = allocation.width; + h = allocation.height; + x = allocation.x; + y = allocation.y; layout = gtk_label_get_layout (GTK_LABEL(widget)); @@ -385,7 +389,7 @@ numbers_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) font_size = pango_font_description_get_size (font_description); */ /* initialize cairo drawing area */ - cr = (cairo_t*) gdk_cairo_create (widget->window); + cr = (cairo_t*) gdk_cairo_create (gtk_widget_get_window (widget)); /* set line width */ cairo_set_line_width (cr, 1.0); |