Restore corrupt desktop

Somehow my Mate desktop got corrupted. It initially had only the home and trash folders. Now it shows all the files and folders in my /home/username folder. If I go into MATE Tweak and uncheck "Show Desktop Icons", all the files and folders disappear. This is not exactly what I want. I would like for my desktop to only show the items I have checked in MATE Tweak.

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

MATE 1.12.1

Any suggestions on how to restore the default configuraiton?

Have you managed somehow to copy or move /home/username into /home/username/Desktop ?

In the spirit of @charles-nix advice I'd recommend to check actual contents of your Desktop folder in Caja.

My /home/username/Desktop folder is empty.

Menu Applications > System tools > dconf Editor
Search for Desktop
Verify settings

@ugnvs in the dconf editor the desktop-is-home-dir flag is off. If I toggle it, nothing happens. I still get all the files and folders appearing on my desktop.

Another place to look is the text file /home/username/.config/userdirs.dirs

Make sure the appropriate line reads:

XDG_DESKTOP_DIR="$HOME/Desktop"
and not
XDG_DESKTOP_DIR="$HOME"

@charles-nix my userdirs.dirs was pointing to the wrong dir. I edited it and rebooted. Now it is:

XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/"
XDG_VIDEOS_DIR="$HOME/Videos"

However, this did not fix my problem.

I erred in the filename. You may have already caught it, so this may not be your problem, but... The correct path and filename is:

/home/username/.config/user-dirs.dirs

and it has to be a plain text file.

Verify that Home flag unchecked in Mate Tweak.

@charles-nix, yes I figured that out.
@ugnvs Unchecking Home in MATE Tweak didn't help.

I have had some strange things happen when changing from one panel layout to another in Tweak. Sometimes I've had things break. Sometimes, quirky behavior has "fixed" itself when switching back to the default layout and then to my preferred one, and vice versa. I'm on 18.04, though, so this might be different for you.

Maybe if you play with those a bit you might get it back. Not a satisfying answer. You shouldn't have to reboot to check--at most a log out/in would be sufficient.

Well, I finally solved the problem. I renamed my dconf folder, logged out and back in.

mv ~/.config/dconf/ ~/.config/dconf.bak

I lost some minor customizations (desktop background), but that was trivial to fix.

Thanks for the help!