icon_info->window = gdk_window_new (gtk_widget_get_window (widget),
&attributes,
attributes_mask);
- gdk_window_set_user_data (icon_info->window, widget);
+ gtk_widget_register_window (widget, icon_info->window);
gtk_widget_queue_resize (widget);
}
&attributes,
attributes_mask);
- gdk_window_set_user_data (priv->text_area, entry);
+ gtk_widget_register_window (widget, priv->text_area);
if (attributes_mask & GDK_WA_CURSOR)
g_object_unref (attributes.cursor);
if (priv->text_area)
{
- gdk_window_set_user_data (priv->text_area, NULL);
+ gtk_widget_unregister_window (widget, priv->text_area);
gdk_window_destroy (priv->text_area);
priv->text_area = NULL;
}
{
if (icon_info->window != NULL)
{
+ gtk_widget_unregister_window (widget, icon_info->window);
gdk_window_destroy (icon_info->window);
icon_info->window = NULL;
}
GtkEntryPrivate *priv = entry->priv;
int i;
- context = gtk_widget_get_style_context (widget);
+ if (gtk_cairo_should_draw_window (cr,
+ gtk_widget_get_window (widget)))
+ {
+ context = gtk_widget_get_style_context (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);
- /* 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);
+ gtk_entry_draw_text (GTK_ENTRY (widget), cr);
- cairo_restore (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);
- /* Draw icons */
- for (i = 0; i < MAX_ICONS; i++)
- {
- EntryIconInfo *icon_info = priv->icons[i];
+ cairo_restore (cr);
- if (icon_info != NULL)
- draw_icon (widget, cr, i);
+ /* Draw icons */
+ for (i = 0; i < MAX_ICONS; i++)
+ {
+ EntryIconInfo *icon_info = priv->icons[i];
+
+ if (icon_info != NULL)
+ draw_icon (widget, cr, i);
+ }
}
return FALSE;
gtk_entry_update_cached_style_values (entry);
- gtk_entry_recompute (entry);
-
icon_theme_changed (entry);
}