Render pager using Cairo instead of GDK
authorPhilip Chimento <philip.chimento@gmail.com>
Sun, 1 Sep 2013 00:14:17 +0000 (17:14 -0700)
committerPhilip Chimento <philip.chimento@gmail.com>
Sun, 8 Sep 2013 18:41:08 +0000 (11:41 -0700)
This was not yet ported on the GTK 3 branch because the pager was
completely replaced by a GtkOverlay.

libchimara/pager.c

index 18203e82486aada302747858a31b8e1765accb5c..a31bb07871fd68a1c6748a7731dc523596be65d2 100644 (file)
@@ -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 */
 }