[vte/vte-next] Use gtk_widget_get_allocated_{width,height}
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next] Use gtk_widget_get_allocated_{width,height}
- Date: Tue, 3 May 2011 14:02:19 +0000 (UTC)
commit 0faf5ed27b5f78136760cef3b58eb76bff7180e5
Author: Christian Persch <chpe gnome org>
Date: Tue May 3 15:04:18 2011 +0200
Use gtk_widget_get_allocated_{width,height}
in ::draw instead of gtk_widget_get_allocation.
src/vte.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 799a9be..e044d24 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -10229,7 +10229,7 @@ vte_terminal_draw(GtkWidget *widget,
VteTerminal *terminal = VTE_TERMINAL (widget);
cairo_rectangle_int_t clip_rect;
cairo_region_t *region;
- GtkAllocation allocation;
+ int allocated_width, allocated_height;
if (!gdk_cairo_get_clip_rectangle (cr, &clip_rect))
return FALSE;
@@ -10249,8 +10249,8 @@ vte_terminal_draw(GtkWidget *widget,
clip_rect.width, clip_rect.height);
}
- terminal = VTE_TERMINAL(widget);
- gtk_widget_get_allocation (widget, &allocation);
+ allocated_width = gtk_widget_get_allocated_width(widget);
+ allocated_height = gtk_widget_get_allocated_height(widget);
/* Designate the start of the drawing operation and clear the area. */
_vte_draw_start(terminal->pvt->draw);
@@ -10266,9 +10266,8 @@ vte_terminal_draw(GtkWidget *widget,
}
_vte_draw_clip(terminal->pvt->draw, region);
- gtk_widget_get_allocation(&terminal->widget, &allocation);
_vte_draw_clear (terminal->pvt->draw, 0, 0,
- allocation.width, allocation.height);
+ allocated_width, allocated_height);
/* Calculate the bounding rectangle. */
{
@@ -10282,8 +10281,8 @@ vte_terminal_draw(GtkWidget *widget,
/* don't bother to enlarge an invalidate all */
if (!(n_rectangles == 1
- && rectangles[0].width == allocation.width
- && rectangles[0].height == allocation.height)) {
+ && rectangles[0].width == allocated_width
+ && rectangles[0].height == allocated_height)) {
cairo_region_t *rr = cairo_region_create ();
/* convert pixels into whole cells */
for (n = 0; n < n_rectangles; n++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]