[vte/vte-next] Don't use gtk_widget_is_drawable



commit eb3dbca7fb95d94228658078b0042e73269e9a81
Author: Christian Persch <chpe gnome org>
Date:   Mon May 16 18:55:29 2011 +0200

    Don't use gtk_widget_is_drawable

 src/vte.c |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index f285a37..53687f9 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -338,12 +338,15 @@ _vte_invalidate_cells(VteTerminal *terminal,
 	cairo_rectangle_int_t rect;
 	glong i;
 
+        if (!gtk_widget_get_realized(&terminal->widget)) {
+                return;
+        }
+
 	if (!column_count || !row_count) {
 		return;
 	}
 
-	if (G_UNLIKELY (! gtk_widget_is_drawable (&terminal->widget)
-				|| terminal->pvt->invalidated_all)) {
+	if (terminal->pvt->invalidated_all) {
 		return;
 	}
 
@@ -459,9 +462,9 @@ _vte_invalidate_all(VteTerminal *terminal)
 
 	g_assert(VTE_IS_TERMINAL(terminal));
 
-	if (! gtk_widget_is_drawable (&terminal->widget)) {
-		return;
-	}
+        if (!gtk_widget_get_realized(&terminal->widget)) {
+                return;
+        }
 	if (terminal->pvt->invalidated_all) {
 		return;
 	}
@@ -640,8 +643,10 @@ _vte_invalidate_cell(VteTerminal *terminal, glong col, glong row)
 	const VteRowData *row_data;
 	int columns;
 
-	if (G_UNLIKELY (! gtk_widget_is_drawable (&terminal->widget)
-				|| terminal->pvt->invalidated_all)) {
+        if (!gtk_widget_get_realized(&terminal->widget)) {
+                return;
+        }
+	if (terminal->pvt->invalidated_all) {
 		return;
 	}
 
@@ -697,7 +702,7 @@ _vte_invalidate_cursor_once(VteTerminal *terminal, gboolean periodic)
 		}
 	}
 
-	if (terminal->pvt->cursor_visible && gtk_widget_is_drawable (&terminal->widget)) {
+	if (terminal->pvt->cursor_visible) {
 		preedit_width = vte_terminal_preedit_width(terminal, FALSE);
 
 		screen = terminal->pvt->screen;
@@ -6545,11 +6550,6 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
         long cell_x, cell_y;
 	gboolean handled = FALSE;
 
-	/* check to see if it matters */
-	if (! gtk_widget_is_drawable (widget)) {
-		return handled;
-	}
-
         (void) _vte_terminal_xy_to_grid(terminal, event->x, event->y, &cell_x, &cell_y);
 	x = event->x - terminal->pvt->padding.left;
 	y = event->y - terminal->pvt->padding.top;
@@ -7278,8 +7278,10 @@ vte_terminal_handle_scroll(VteTerminal *terminal)
 	screen->scroll_delta = adj;
 
 	/* Sanity checks. */
-	if (! gtk_widget_is_drawable (&terminal->widget)
-			|| terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
+        if (!gtk_widget_get_realized(&terminal->widget)) {
+                return;
+        }
+	if (terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
 		return;
 	}
 
@@ -13240,8 +13242,8 @@ update_regions (VteTerminal *terminal)
 	cairo_region_t *region;
 	GdkWindow *window;
 
-	if (G_UNLIKELY (! gtk_widget_is_drawable (&terminal->widget)
-				|| terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED)) {
+        if (!gtk_widget_get_realized(&terminal->widget) ||
+            terminal->pvt->visibility_state == GDK_VISIBILITY_FULLY_OBSCURED) {
 		reset_update_regions (terminal);
 		return FALSE;
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]