From: Jim Evins Date: Tue, 5 Oct 2010 02:52:24 +0000 (-0400) Subject: Fix drawing problems with view.c X-Git-Tag: glabels-2_3_1~141^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=799a7f4911e9abd575c2b7683750aeca1b905ca8;p=glabels Fix drawing problems with view.c - Create separate cairo_t from bin_window and draw into it. - For manual updates, create allocation rectangle manually --- diff --git a/.gitignore b/.gitignore index ca042820..c12c8a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ glabels-*.tar.gz /src/marshal.[ch] /src/stock-pixmaps/stockpixbufs.h +/src/cursors/cursor_pixdata.h /src/glabels /src/glabels-3 /src/glabels-batch @@ -55,6 +56,10 @@ glabels-*.tar.gz /data/mime/glabels*.xml +/data/schemas/*.gschema.valid +/data/schemas/*.gschema.xml +/data/schemas/*.gschema.xml.in + /po/.intltool-merge-cache /po/*.gmo /po/POTFILES diff --git a/src/view.c b/src/view.c index 3ea2ed95..983f8e56 100644 --- a/src/view.c +++ b/src/view.c @@ -486,7 +486,10 @@ gl_view_update (glView *view) { view->update_scheduled_flag = TRUE; - gtk_widget_get_allocation (GTK_WIDGET (view->canvas), &allocation); + allocation.x = 0; + allocation.y = 0; + allocation.width = gtk_widget_get_allocated_width (view->canvas); + allocation.height = gtk_widget_get_allocated_height (view->canvas); gdk_window_invalidate_rect (window, &allocation, TRUE); } @@ -540,10 +543,19 @@ static gboolean draw_cb (glView *view, cairo_t *cr) { + GdkWindow *bin_window; + cairo_t *bin_cr; + gl_debug (DEBUG_VIEW, "START"); view->update_scheduled_flag = FALSE; - draw_layers (view, cr); + + bin_window = gtk_layout_get_bin_window (GTK_LAYOUT (view->canvas)); + bin_cr = gdk_cairo_create (bin_window); + + draw_layers (view, bin_cr); + + cairo_destroy (bin_cr); gl_debug (DEBUG_VIEW, "END");