I have a solution and it has nothing to do with guns. It has to do with the media.
They need to stop plastering these asshole's names and pictures on every website, newspaper, and tv station. By doing so, they are glamorizing them, setting them in stone of American history, making them famous (or infamous in this case). Instead, they should focus on the victims and their families ONLY.
I know it goes against all the rules of the press, withholding facts from a story, but if all the major news outlets got together on this, for the betterment of the community, it could work.
It won't stop workplace shootings where the perp has a grudge to settle against certain people or company, but it would curtail these random mass murders where the killers just shoot anyone in the vicinity so they can make the national news.
Fact is, these people are going to kill themselves, they know that going in. So they figure, I might as well take out as many as I can on the way out so people will always remember me.
Stop giving them infamy, and they will be less inclined to take out a large number of innocents.