Generally I find it anoing to close a system tray app when my computer is lagging.
It's an interesting idea. But I think it would be quite disruptive, and I can foresee people accidentally killing apps all the time. We could add a confirmation dialog, but then it wouldn't solve the problem of wanting to kill apps when the system is lagging, since the dialog would just lag too. I think for this use case, you should close the app from its Task Manager icon. If it doesn't have one because it has a system tray icon instead, well, now you've learned one of the many reasons why system tray icons for apps are silly and problematic. In this case you can close the app from the System Monitor, or invoke the systemwide "kill a window", invoked by Meta+Ctrl+Escape if System Monitor won't load.
Middle click is already reserved for Secondary Action: https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/ Application can implement it for a close action. Some Plasmoids use it, for example Volume uses middle click for mute, Notification to turn off notification etc.
wont work get it ok