Skip to content

Fix icon view drawing glitches

Brian Tarricone requested to merge kelnos/xfdesktop:fix-drawing-glitches into master

This doesn't show up (much?) on X11, but is very clear on Wayland. You cannot do any kind of drawing outside the GtkWidget::draw handler. However, we were doing a draw inside xfdesktop_icon_view_add_item_internal(), which can be called from anywhere.

The key thing that we need to do when adding a new item is to calculate and set the icon's extents, and then call gtk_widget_queue_draw_area() on the newly-calculated extents, and let GTK handle calling our draw handler, with graphics state properly set up.

Tested on both X11 & Wayland.

Edited by Brian Tarricone

Merge request reports