An other solution is to add the xhost command to the ".bashrc" like this:
## xhost for root ##
xhost + "local:root@localhost"
xhost -
or enable it system wide, and i do not know if this is a security hole,
you can edit "/etc/X11/xsession.d/35x11-common_xhost-local" like this:
# This file is sourced by Xsession(5), not executed.
# If xhost (from x11-xserver-utils) is installed, use it to give access
# to the X server to any process from the same user on the local host.
# Unlike other uses of xhost, this is safe since the kernel can check
# the actual owner of the calling process.
if type xhost >/dev/null 2>&1; then
xhost +si:localuser:$(id -un) || :
fi
if type xhost >/dev/null 2>&1; then
xhost +si:localuser:root || :
fi
Then you are able to run, after doing a "su", a graphical program like an editor or a filemanager and so on.
But be aware of the security of your system!