diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c index 93ef9966..794a2785 100644 --- a/src/gcal-event-widget.c +++ b/src/gcal-event-widget.c @@ -577,15 +577,6 @@ gcal_event_widget_draw (GtkWidget *widget, cairo_paint (cr); } - /* Setup the drag n' drop icon */ - g_clear_object (&self->dnd_pixbuf); - - self->dnd_pixbuf = gdk_pixbuf_get_from_window (self->event_window, - 0, - 0, - width, - height); - pango_font_description_free (font_desc); g_object_unref (layout); g_free (display_text); @@ -629,6 +620,15 @@ gcal_event_widget_drag_begin (GtkWidget *widget, { GcalEventWidget *self = GCAL_EVENT_WIDGET (widget); + /* Setup the drag n' drop icon */ + g_clear_object (&self->dnd_pixbuf); + + self->dnd_pixbuf = gdk_pixbuf_get_from_window (self->event_window, + 0, + 0, + gtk_widget_get_allocated_width (widget), + gtk_widget_get_allocated_height (widget)); + gtk_drag_set_icon_pixbuf (context, self->dnd_pixbuf, 0, 0); }