diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c index 15c83d692e16c4c97f46a7d05ef7fbf6e581eff4..ee565a84515b708f49f1f94cd3338127fc8df832 100644 --- a/thunar/thunar-abstract-icon-view.c +++ b/thunar/thunar-abstract-icon-view.c @@ -77,8 +77,8 @@ static gboolean thunar_abstract_icon_view_button_press_event (ExoIconView static gboolean thunar_abstract_icon_view_button_release_event (ExoIconView *view, GdkEventButton *event, ThunarAbstractIconView *abstract_icon_view); -static gboolean thunar_abstract_icon_view_expose_event (ExoIconView *view, - GdkEventExpose *event, +static gboolean thunar_abstract_icon_view_draw (ExoIconView *view, + cairo_t *cr, ThunarAbstractIconView *abstract_icon_view); static gboolean thunar_abstract_icon_view_key_press_event (ExoIconView *view, GdkEventKey *event, @@ -558,8 +558,8 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view, { abstract_icon_view->priv->gesture_start_x = abstract_icon_view->priv->gesture_current_x = event->x; abstract_icon_view->priv->gesture_start_y = abstract_icon_view->priv->gesture_current_y = event->y; - abstract_icon_view->priv->gesture_expose_id = g_signal_connect_after (G_OBJECT (view), "expose-event", - G_CALLBACK (thunar_abstract_icon_view_expose_event), + abstract_icon_view->priv->gesture_expose_id = g_signal_connect_after (G_OBJECT (view), "draw", + G_CALLBACK (thunar_abstract_icon_view_draw), G_OBJECT (abstract_icon_view)); abstract_icon_view->priv->gesture_motion_id = g_signal_connect (G_OBJECT (view), "motion-notify-event", G_CALLBACK (thunar_abstract_icon_view_motion_notify_event), @@ -617,16 +617,15 @@ thunar_abstract_icon_view_button_release_event (ExoIconView *view, static gboolean -thunar_abstract_icon_view_expose_event (ExoIconView *view, - GdkEventExpose *event, - ThunarAbstractIconView *abstract_icon_view) +thunar_abstract_icon_view_draw (ExoIconView *view, + cairo_t *cr, + ThunarAbstractIconView *abstract_icon_view) { GtkIconSet *stock_icon_set; GtkAction *action = NULL; GdkPixbuf *stock_icon = NULL; gchar *stock_id; GdkColor bg; - cairo_t *cr; gint x, y; _thunar_return_val_if_fail (EXO_IS_ICON_VIEW (view), FALSE); @@ -635,9 +634,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view, _thunar_return_val_if_fail (abstract_icon_view->priv->gesture_motion_id > 0, FALSE); _thunar_return_val_if_fail (abstract_icon_view->priv->gesture_release_id > 0, FALSE); - /* create the cairo context (is already clipped) */ - cr = gdk_cairo_create (event->window); - /* shade the abstract_icon view content while performing mouse gestures */ bg = gtk_widget_get_style (GTK_WIDGET (view))->base[GTK_STATE_NORMAL]; cairo_set_source_rgba (cr, bg.red / 65535.0, bg.green / 65535.0, bg.blue / 65535.0, 0.7); @@ -682,9 +678,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view, g_free (stock_id); } - /* destroy context */ - cairo_destroy (cr); - return FALSE; }