[glabels/gtk3] Fix drawing problems with view.c
- From: Jim Evins <jimevins src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glabels/gtk3] Fix drawing problems with view.c
- Date: Tue, 5 Oct 2010 02:55:29 +0000 (UTC)
commit 799a7f4911e9abd575c2b7683750aeca1b905ca8
Author: Jim Evins <evins snaught com>
Date: Mon Oct 4 22:52:24 2010 -0400
Fix drawing problems with view.c
- Create separate cairo_t from bin_window and draw into it.
- For manual updates, create allocation rectangle manually
.gitignore | 5 +++++
src/view.c | 16 ++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index ca04282..c12c8a9 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 3ea2ed9..983f8e5 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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]