From 01c41167a7e92c05fe54d547324600f0cf3cf7b8 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sat, 31 Aug 2013 17:14:17 -0700 Subject: [PATCH] Render pager using Cairo instead of GDK This was not yet ported on the GTK 3 branch because the pager was completely replaced by a GtkOverlay. --- libchimara/pager.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libchimara/pager.c b/libchimara/pager.c index 18203e8..a31bb07 100644 --- a/libchimara/pager.c +++ b/libchimara/pager.c @@ -136,16 +136,17 @@ pager_on_expose(GtkTextView *textview, GdkEventExpose *event, winid_t win) gint promptwidth, promptheight; pango_layout_get_pixel_size(win->pager_layout, &promptwidth, &promptheight); - gint winx, winy, winwidth, winheight; + int winx, winy; gdk_window_get_position(event->window, &winx, &winy); - gdk_drawable_get_size(GDK_DRAWABLE(event->window), &winwidth, &winheight); + int winwidth = gdk_window_get_width(event->window); + int winheight = gdk_window_get_height(event->window); /* Draw the 'more' tag */ - GdkGC *context = gdk_gc_new(GDK_DRAWABLE(event->window)); - gdk_draw_layout(event->window, context, - winx + winwidth - promptwidth, - winy + winheight - promptheight, - win->pager_layout); + cairo_t *cr = gdk_cairo_create(event->window); + cairo_move_to(cr, + winx + winwidth - promptwidth, + winy + winheight - promptheight); + pango_cairo_show_layout(cr, win->pager_layout); return FALSE; /* Propagate event further */ } -- 2.30.2