[vte/vte-next: 54/114] Use gtk_widget_get_allocated_{width,height}
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 54/114] Use gtk_widget_get_allocated_{width,height}
- Date: Mon, 30 May 2011 17:11:17 +0000 (UTC)
commit e3254820986463e7e44aaacfdd39ff6b22cb4350
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 79a57bc..fd8dfd5 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -10227,7 +10227,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;
@@ -10245,8 +10245,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);
@@ -10262,9 +10262,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. */
{
@@ -10278,8 +10277,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]