From 8e29222d95449278d66f3e067d7dc1dcb7f6dcae Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 27 Oct 2016 20:46:08 -0400 Subject: [PATCH] Convert GtkEntry to indirect rendering Warning! This unveils some positioning issue with the secondary icon. --- gtk/gtkentry.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 2f91597355..3227d47e33 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -414,8 +414,8 @@ static void gtk_entry_map (GtkWidget *widget); static void gtk_entry_unmap (GtkWidget *widget); static void gtk_entry_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static gint gtk_entry_draw (GtkWidget *widget, - cairo_t *cr); +static GskRenderNode *gtk_entry_get_render_node (GtkWidget *widget, + GskRenderer *renderer); static gboolean gtk_entry_event (GtkWidget *widget, GdkEvent *event); static gint gtk_entry_enter_notify (GtkWidget *widget, @@ -761,7 +761,7 @@ gtk_entry_class_init (GtkEntryClass *class) widget_class->unrealize = gtk_entry_unrealize; widget_class->measure = gtk_entry_measure_; widget_class->size_allocate = gtk_entry_size_allocate; - widget_class->draw = gtk_entry_draw; + widget_class->get_render_node = gtk_entry_get_render_node; widget_class->enter_notify_event = gtk_entry_enter_notify; widget_class->leave_notify_event = gtk_entry_leave_notify; widget_class->event = gtk_entry_event; @@ -3591,13 +3591,11 @@ should_prelight (GtkEntry *entry, return TRUE; } -static gboolean -gtk_entry_draw (GtkWidget *widget, - cairo_t *cr) +static GskRenderNode * +gtk_entry_get_render_node (GtkWidget *widget, + GskRenderer *renderer) { - gtk_css_gadget_draw (GTK_ENTRY (widget)->priv->gadget, cr); - - return GDK_EVENT_PROPAGATE; + return gtk_css_gadget_get_render_node (GTK_ENTRY (widget)->priv->gadget, renderer, FALSE); } #define UNDERSHOOT_SIZE 20