Various xdg patches

Merge or cherry-pick as desired. :-)