I tested your patch for the issue launching Audacity as root on Ubuntu. The patch does allow Audacity to launch, to offer the Directories Preferences to change the temp directory, then close with a message telling the user to launch Audacity again. So it is an advance for sure.
On Ubuntu, once I have run Audacity as root and changed the temp dir, I can’t run Audacity as my own user without changing the temp dir. Then having changed the temp dir as my own user, I can’t run Audacity as root, even though root clearly has permission to modify my own user’s temp dir. So the problem seems specifically about ownership and not permissions in that case. I am a Windows user mainly, but do I assume this is normal behaviour on Linux, or could Audacity be more user-friendly here?
Anyhow, I will mention your patch to the powers that be - I would like to see this fixed. Please note that if you submit more patches they should be against HEAD (there is no GStreamerStartup(); in src/AudacityApp.cpp).
Audacity does have a warning if the space available to the temp dir is 100 MB or less. Presumably Audacity never gets far enough to run the check if it forces the Preferences dialogue as a result of having nowhere to store temp files?
Arguably there are enough message boxes already when Audacity can’t store temp files, without adding a message about shortage of space. Also with your patch, wouldn’t the Preferences show that there was no space in the directory Audacity was trying to write its temp dir to?