Running graphical applications with sudo can sometimes lead to problems like this.
Explanation
sudo runs the program with superuser privileges (like running as root), but the program still sees the current home directory as your home directory.
So, when the software writes its configuration files, it'll end up creating files in your home directory that are owned by the root user. You end up with files you yourself cannot edit or delete, and software running as you won't be able to modify it either, leading to more problems.
What is the best solution?
There is an alternative: pkexec.
Note: a previous version of this answer recommended the now-deprecated command gksudo.
The pkexec command will run the command in an environment which can safely run graphical applications as superuser without polluting your home directory with its configuration. Among other things, the home environment variable will be set appropriately.
To run X applications, you need to set some additional environment variables:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY <command> <arguments>
What you can do is create a script to emulate the old gksudo behavior. Create a shell script gksudo in /usr/local/bin containing the following, and make it executable:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $@
The DISPLAY and XAUTHORITY environment variables aren't usually needed, but this version makes it compatible with certain system configurations.
Why does this affect graphical applications?
This doesn't just affect graphical applications, nor does it affect all graphical applications. It affects applications that store configuration inside the current user's home directory. This is just more common among graphical applications.
Sometimes applications will be able to detect if they're run with sudo and adjust their behaviour accordingly, but this is not common with graphical applications which are usually not expected to be run with sudo.
How do I fix the problem?
You'll need to find root-owned files and directories within your home directory and remove them. It's better to remove them than change their ownership in my opinion, as they were not intended for your user, but the root user, so there may be unexpected effects if you simply change ownership. You can of course back them up in case you decide there's something you want in them later.
To find root-owned files in your home directory:
find ~ -user root
If you are still having problems with some applications (run as your user), try rebooting to clear out /tmp and anything still running. Occasionally some applications might have corrupted their existing config files and need you to remove all their configuration in your home directory, but hopefully this won't be the case for many.