So if you install Mir and uninstall X11, can you fix this problem completely? Also, are snap packages less secure than debian packages, or is it just that they aren’t as secure as they claim?
Just less secure than they claim. The problem is that X11 has no sandboxing or isolation between applications, so any X11 application can get keypresses from another etc. Obviously you can package an X11 application into a debian package and achieve the same thing, but debian packages don’t promise any security. (Nor do they have any, by installing a debian package you basically let it do whatever it wants).
I was under the impression that snap is supposed to be more for IOT and embedded devices. Things where the minimal amount of software is going to be installed. In that case having bloated and old software that breaks sand boxing is not really a problem. I may be mistaken though.