From: Philip Chimento Date: Sun, 1 Sep 2013 00:14:17 +0000 (-0700) Subject: Render pager using Cairo instead of GDK X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=01c41167a7e92c05fe54d547324600f0cf3cf7b8 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. --- 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 */ }