diff options
author | infirit <[email protected]> | 2014-07-03 16:18:05 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-07-03 17:47:52 +0200 |
commit | 3689698d12b93355a273e1aae1936ff9a74defd1 (patch) | |
tree | 7e5e73146455351b11194e0afa165f9f83156063 /src/themes/coco/coco-theme.c | |
parent | 0db54b288c7eca478a13c33ccd3b202d6e3688f9 (diff) | |
download | mate-notification-daemon-3689698d12b93355a273e1aae1936ff9a74defd1.tar.bz2 mate-notification-daemon-3689698d12b93355a273e1aae1936ff9a74defd1.tar.xz |
Cleanup GTK_CHECK_VERSION and unify code where possible
* Use GtkAllocation for both Gtk+ versions, added in 2.18
* Bump gdk-pixbuf required to 2.22 (release 2010)
* GDK_DISPLAY_XDISPLAY | Since always
* gdk_display_get_default | Since 2.22
* gdk_window_get_screen | Since 2.24
* gtk_widget_get_window | Since 2.14
Diffstat (limited to 'src/themes/coco/coco-theme.c')
-rw-r--r-- | src/themes/coco/coco-theme.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/themes/coco/coco-theme.c b/src/themes/coco/coco-theme.c index d4747f2..3d13f14 100644 --- a/src/themes/coco/coco-theme.c +++ b/src/themes/coco/coco-theme.c @@ -171,11 +171,7 @@ paint_window(GtkWidget *widget, #endif if (windata->width == 0) { -#if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_get_allocation(windata->win, &allocation); -#else - allocation = windata->win->allocation; -#endif windata->width = allocation.width; windata->height = allocation.height; } @@ -221,25 +217,17 @@ paint_window(GtkWidget *widget, #endif } -#if GTK_CHECK_VERSION(3, 0, 0) context = gdk_cairo_create(gtk_widget_get_window(widget)); -#else - context = gdk_cairo_create(widget->window); -#endif cairo_set_operator(context, CAIRO_OPERATOR_SOURCE); -#if GTK_CHECK_VERSION (3, 0, 0) surface = cairo_surface_create_similar(cairo_get_target(context), CAIRO_CONTENT_COLOR_ALPHA, windata->width, windata->height); +#if GTK_CHECK_VERSION (3, 0, 0) cairo_set_source_surface (cr, surface, 0, 0); #else - surface = cairo_surface_create_similar(cairo_get_target(context), - CAIRO_CONTENT_COLOR_ALPHA, - widget->allocation.width, - widget->allocation.height); cr = cairo_create(surface); #endif @@ -287,11 +275,7 @@ countdown_expose_cb(GtkWidget *pie, cairo_t *cr; #endif -#if GTK_CHECK_VERSION(3, 0, 0) context = gdk_cairo_create(gtk_widget_get_window(pie)); -#else - context = gdk_cairo_create(pie->window); -#endif cairo_set_operator(context, CAIRO_OPERATOR_SOURCE); #if GTK_CHECK_VERSION (3, 0, 0) @@ -622,11 +606,7 @@ add_notification_action(GtkWindow *nw, const char *text, const char *key, buf = g_strdup_printf("stock_%s", key); pixbuf = gtk_icon_theme_load_icon( gtk_icon_theme_get_for_screen( -#if GTK_CHECK_VERSION(3, 0, 0) gdk_window_get_screen(gtk_widget_get_window(GTK_WIDGET(nw)))), -#else - gdk_drawable_get_screen(GTK_WIDGET(nw)->window)), -#endif buf, 16, GTK_ICON_LOOKUP_USE_BUILTIN, NULL); g_free(buf); |