[gtk+] entry: Remove needless check
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] entry: Remove needless check
- Date: Tue, 19 Apr 2011 20:26:53 +0000 (UTC)
commit c70698084c5c9faa4c7a8ffbc3e89c8e8cd5280c
Author: Benjamin Otte <otte redhat com>
Date: Tue Apr 19 00:56:16 2011 +0200
entry: Remove needless check
The only window we're ever called to draw is our own window. D'oh.
gtk/gtkentry.c | 53 +++++++++++++++++++++++++----------------------------
1 files changed, 25 insertions(+), 28 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 5c690e6..bb85ead 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3554,44 +3554,41 @@ gtk_entry_draw (GtkWidget *widget,
gtk_style_context_save (context);
gtk_style_context_set_state (context, state);
- if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
- {
- /* Draw entry_bg, shadow, progress and focus */
- gtk_entry_draw_frame (widget, context, cr);
+ /* Draw entry_bg, shadow, progress and focus */
+ gtk_entry_draw_frame (widget, context, cr);
- /* Draw text and cursor */
- cairo_save (cr);
+ /* Draw text and cursor */
+ cairo_save (cr);
- gtk_cairo_transform_to_window (cr, widget, priv->text_area);
+ gtk_cairo_transform_to_window (cr, widget, priv->text_area);
- if (priv->dnd_position != -1)
- gtk_entry_draw_cursor (GTK_ENTRY (widget), cr, CURSOR_DND);
-
- gtk_entry_draw_text (GTK_ENTRY (widget), cr);
+ if (priv->dnd_position != -1)
+ gtk_entry_draw_cursor (GTK_ENTRY (widget), cr, CURSOR_DND);
+
+ gtk_entry_draw_text (GTK_ENTRY (widget), cr);
- /* When no text is being displayed at all, don't show the cursor */
- if (gtk_entry_get_display_mode (entry) != DISPLAY_BLANK &&
- gtk_widget_has_focus (widget) &&
- priv->selection_bound == priv->current_pos && priv->cursor_visible)
- gtk_entry_draw_cursor (GTK_ENTRY (widget), cr, CURSOR_STANDARD);
+ /* When no text is being displayed at all, don't show the cursor */
+ if (gtk_entry_get_display_mode (entry) != DISPLAY_BLANK &&
+ gtk_widget_has_focus (widget) &&
+ priv->selection_bound == priv->current_pos && priv->cursor_visible)
+ gtk_entry_draw_cursor (GTK_ENTRY (widget), cr, CURSOR_STANDARD);
- cairo_restore (cr);
+ cairo_restore (cr);
- /* Draw icons */
- for (i = 0; i < MAX_ICONS; i++)
- {
- EntryIconInfo *icon_info = priv->icons[i];
+ /* Draw icons */
+ for (i = 0; i < MAX_ICONS; i++)
+ {
+ EntryIconInfo *icon_info = priv->icons[i];
- if (icon_info != NULL)
- {
- cairo_save (cr);
+ if (icon_info != NULL)
+ {
+ cairo_save (cr);
- gtk_cairo_transform_to_window (cr, widget, icon_info->window);
+ gtk_cairo_transform_to_window (cr, widget, icon_info->window);
- draw_icon (widget, cr, i);
+ draw_icon (widget, cr, i);
- cairo_restore (cr);
- }
+ cairo_restore (cr);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]