It's not a bug. SuperUser has no XDG_RUNTIME_DIR variable set. To fix it, replace sudo gedit call with pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit
It's not a bug. SuperUser has no XDG_RUNTIME_DIR variable set. To fix it, replace sudo gedit call with $XAUTHORITY gedit
pkexec env DISPLAY=$DISPLAY XAUTHORITY=